2020-08-21 00:45:24 +00:00
|
|
|
import React, { useEffect } from 'react';
|
|
|
|
import ReactGA from 'react-ga';
|
2020-10-13 03:59:11 +00:00
|
|
|
import { Route, RouteComponentProps, Switch } from 'react-router-dom';
|
2019-06-10 02:26:20 +00:00
|
|
|
import LoginContainer from '@/components/auth/LoginContainer';
|
2019-06-12 05:02:18 +00:00
|
|
|
import ForgotPasswordContainer from '@/components/auth/ForgotPasswordContainer';
|
2019-06-16 23:57:57 +00:00
|
|
|
import ResetPasswordContainer from '@/components/auth/ResetPasswordContainer';
|
2019-06-17 01:07:57 +00:00
|
|
|
import LoginCheckpointContainer from '@/components/auth/LoginCheckpointContainer';
|
2020-04-17 18:17:01 +00:00
|
|
|
import NotFound from '@/components/screens/NotFound';
|
2019-06-10 02:26:20 +00:00
|
|
|
|
2020-08-21 00:45:24 +00:00
|
|
|
export default ({ location, history, match }: RouteComponentProps) => {
|
|
|
|
useEffect(() => {
|
|
|
|
ReactGA.pageview(location.pathname);
|
|
|
|
}, [ location.pathname ]);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={'pt-8 xl:pt-32'}>
|
|
|
|
<Switch location={location}>
|
|
|
|
<Route path={`${match.path}/login`} component={LoginContainer} exact/>
|
|
|
|
<Route path={`${match.path}/login/checkpoint`} component={LoginCheckpointContainer}/>
|
|
|
|
<Route path={`${match.path}/password`} component={ForgotPasswordContainer} exact/>
|
|
|
|
<Route path={`${match.path}/password/reset/:token`} component={ResetPasswordContainer}/>
|
|
|
|
<Route path={`${match.path}/checkpoint`} />
|
|
|
|
<Route path={'*'}>
|
|
|
|
<NotFound onBack={() => history.push('/auth/login')} />
|
|
|
|
</Route>
|
|
|
|
</Switch>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|