Files
ohif-viewer/platform/viewer/src/App.js
T

46 lines
1.0 KiB
JavaScript
Raw Normal View History

2020-03-05 18:12:46 -03:00
import React from 'react';
import PropTypes from 'prop-types';
import { BrowserRouter, HashRouter } from 'react-router-dom';
2020-04-07 17:16:11 -03:00
import { ThemeWrapper } from '@ohif/ui';
2019-08-15 09:12:48 +02:00
import routes from './routes';
function App({ config }) {
const { routerBasename } = config;
const Router = JSON.parse(process.env.USE_HASH_ROUTER)
? HashRouter
: BrowserRouter;
2020-03-05 18:12:46 -03:00
return (
<Router basename={routerBasename}>
<ThemeWrapper>{routes()}</ThemeWrapper>
</Router>
);
}
App.propTypes = {
config: PropTypes.oneOfType([
PropTypes.func,
PropTypes.shape({
routerBasename: PropTypes.string.isRequired,
oidc: PropTypes.array,
whiteLabeling: PropTypes.shape({
createLogoComponentFn: PropTypes.func,
}),
extensions: PropTypes.array,
}),
]).isRequired,
/* Extensions that are "bundled" or "baked-in" to the application */
defaultExtensions: PropTypes.array,
};
App.defaultProps = {
config: {
showStudyList: true,
oidc: [],
extensions: [],
},
defaultExtensions: [],
2020-03-05 18:12:46 -03:00
};
2020-03-05 18:12:46 -03:00
export default App;