-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathBaseModuleRouter.tsx
More file actions
31 lines (25 loc) · 964 Bytes
/
BaseModuleRouter.tsx
File metadata and controls
31 lines (25 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import React from 'react';
import { Route, Switch, Redirect } from 'react-router';
import { withLazy } from 'utils';
import { OnlyUnauthorizedRoute } from 'shared/guards';
const ForgottenPassword = withLazy(() => import('./forgotten-password'));
const Home = withLazy(() => import('./home'));
const Login = withLazy(() => import('./login'));
const Register = withLazy(() => import('./register'));
const BaseModuleRouter = (): JSX.Element => {
return (
<Switch>
<OnlyUnauthorizedRoute
exact
path="/forgotten-password"
redirect="/app"
component={ForgottenPassword}
/>
<OnlyUnauthorizedRoute exact path="/login" redirect="/app" component={Login} />
<OnlyUnauthorizedRoute exact path="/register" redirect="/app" component={Register} />
<Route exact path="/" component={Home} />
<Route path="**" render={() => <Redirect to="/" />} />
</Switch>
);
};
export default BaseModuleRouter;