React 18 and Vite (#4510)

This commit is contained in:
Matthew Penner 2022-11-25 13:25:03 -07:00 committed by GitHub
parent 1bb1b13f6d
commit 21613fa602
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
244 changed files with 4547 additions and 8933 deletions

View file

@ -1,29 +1,23 @@
import React from 'react';
import { Route, Switch, useRouteMatch } from 'react-router-dom';
import { Route, Routes, useNavigate } from 'react-router-dom';
import LoginContainer from '@/components/auth/LoginContainer';
import ForgotPasswordContainer from '@/components/auth/ForgotPasswordContainer';
import ResetPasswordContainer from '@/components/auth/ResetPasswordContainer';
import LoginCheckpointContainer from '@/components/auth/LoginCheckpointContainer';
import { NotFound } from '@/components/elements/ScreenBlock';
import { useHistory, useLocation } from 'react-router';
export default () => {
const history = useHistory();
const location = useLocation();
const { path } = useRouteMatch();
const navigate = useNavigate();
return (
<div className={'pt-8 xl:pt-32'}>
<Switch location={location}>
<Route path={`${path}/login`} component={LoginContainer} exact />
<Route path={`${path}/login/checkpoint`} component={LoginCheckpointContainer} />
<Route path={`${path}/password`} component={ForgotPasswordContainer} exact />
<Route path={`${path}/password/reset/:token`} component={ResetPasswordContainer} />
<Route path={`${path}/checkpoint`} />
<Route path={'*'}>
<NotFound onBack={() => history.push('/auth/login')} />
</Route>
</Switch>
<div className="pt-8 xl:pt-32">
<Routes>
<Route path="login" element={<LoginContainer />} />
<Route path="login/checkpoint/*" element={<LoginCheckpointContainer />} />
<Route path="password" element={<ForgotPasswordContainer />} />
<Route path="password/reset/:token" element={<ResetPasswordContainer />} />
<Route path="*" element={<NotFound onBack={() => navigate('/auth/login')} />} />
</Routes>
</div>
);
};