2019-12-09 12:37:07 +05:30
|
|
|
import { hot } from 'react-hot-loader/root';
|
2020-07-06 21:59:56 +05:30
|
|
|
import React, { ComponentType } from 'react';
|
2019-12-09 12:37:07 +05:30
|
|
|
import { Route, Switch } from 'react-router-dom';
|
2020-07-06 21:59:56 +05:30
|
|
|
|
2020-07-22 15:31:12 +05:30
|
|
|
import { Store } from 'app/types';
|
2019-12-09 12:37:07 +05:30
|
|
|
import AuthFlowRoute from 'app/containers/AuthFlowRoute';
|
|
|
|
import RootPage from 'app/pages/root/RootPage';
|
2019-12-30 13:45:40 +05:30
|
|
|
import { ComponentLoader } from 'app/components/ui/loader';
|
2019-12-09 12:37:07 +05:30
|
|
|
|
|
|
|
import ContextProvider from './ContextProvider';
|
|
|
|
|
2020-07-06 21:59:56 +05:30
|
|
|
import type { History } from 'history';
|
|
|
|
|
2019-12-30 13:45:40 +05:30
|
|
|
const SuccessOauthPage = React.lazy(() =>
|
2020-05-24 04:38:24 +05:30
|
|
|
import(/* webpackChunkName: "page-oauth-success" */ 'app/pages/auth/SuccessOauthPage'),
|
2019-12-30 13:45:40 +05:30
|
|
|
);
|
|
|
|
|
2020-07-06 21:59:56 +05:30
|
|
|
interface Props {
|
|
|
|
store: Store;
|
|
|
|
history: History;
|
|
|
|
}
|
|
|
|
|
|
|
|
const App: ComponentType<Props> = ({ store, history }) => (
|
2020-05-24 04:38:24 +05:30
|
|
|
<ContextProvider store={store} history={history}>
|
|
|
|
<React.Suspense fallback={<ComponentLoader />}>
|
|
|
|
<Switch>
|
|
|
|
<Route path="/oauth2/code/success" component={SuccessOauthPage} />
|
|
|
|
<AuthFlowRoute path="/oauth2/:version(v\d+)/:clientId?" component={() => null} />
|
|
|
|
<Route path="/" component={RootPage} />
|
|
|
|
</Switch>
|
|
|
|
</React.Suspense>
|
|
|
|
</ContextProvider>
|
2019-12-09 12:37:07 +05:30
|
|
|
);
|
|
|
|
|
|
|
|
export default hot(App);
|