|
1 | | -import React, { useEffect } from 'react'; |
2 | | -import ReactGA from 'react-ga'; |
| 1 | +import React from 'react'; |
3 | 2 | import { Route, RouteComponentProps, Switch } from 'react-router-dom'; |
4 | 3 | import LoginContainer from '@/components/auth/LoginContainer'; |
5 | 4 | import ForgotPasswordContainer from '@/components/auth/ForgotPasswordContainer'; |
6 | 5 | import ResetPasswordContainer from '@/components/auth/ResetPasswordContainer'; |
7 | 6 | import LoginCheckpointContainer from '@/components/auth/LoginCheckpointContainer'; |
8 | 7 | import NotFound from '@/components/screens/NotFound'; |
9 | 8 |
|
10 | | -export default ({ location, history, match }: RouteComponentProps) => { |
11 | | - useEffect(() => { |
12 | | - ReactGA.pageview(location.pathname); |
13 | | - }, [ location.pathname ]); |
14 | | - |
15 | | - return ( |
16 | | - <div className={'pt-8 xl:pt-32'}> |
17 | | - <Switch location={location}> |
18 | | - <Route path={`${match.path}/login`} component={LoginContainer} exact/> |
19 | | - <Route path={`${match.path}/login/checkpoint`} component={LoginCheckpointContainer}/> |
20 | | - <Route path={`${match.path}/password`} component={ForgotPasswordContainer} exact/> |
21 | | - <Route path={`${match.path}/password/reset/:token`} component={ResetPasswordContainer}/> |
22 | | - <Route path={`${match.path}/checkpoint`} /> |
23 | | - <Route path={'*'}> |
24 | | - <NotFound onBack={() => history.push('/auth/login')} /> |
25 | | - </Route> |
26 | | - </Switch> |
27 | | - </div> |
28 | | - ); |
29 | | -}; |
| 9 | +export default ({ location, history, match }: RouteComponentProps) => ( |
| 10 | + <div className={'pt-8 xl:pt-32'}> |
| 11 | + <Switch location={location}> |
| 12 | + <Route path={`${match.path}/login`} component={LoginContainer} exact/> |
| 13 | + <Route path={`${match.path}/login/checkpoint`} component={LoginCheckpointContainer}/> |
| 14 | + <Route path={`${match.path}/password`} component={ForgotPasswordContainer} exact/> |
| 15 | + <Route path={`${match.path}/password/reset/:token`} component={ResetPasswordContainer}/> |
| 16 | + <Route path={`${match.path}/checkpoint`}/> |
| 17 | + <Route path={'*'}> |
| 18 | + <NotFound onBack={() => history.push('/auth/login')}/> |
| 19 | + </Route> |
| 20 | + </Switch> |
| 21 | + </div> |
| 22 | +); |
0 commit comments