1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-04 11:17:02 +02:00
unleash.unleash/frontend/src/component/common/NotFound/NotFound.tsx
olav d8143c6ff4 chore: update react-router to v6 (#946)
* refactor: fix child selector warnings

* refactor: update react-router-dom

* refactor: use BrowserRouter as in react-router docs

* refactor: replace Redirect with Navigate

* refactor: replace Switch with Routes

* refactor: replace useHistory with useNavigate

* refactor: replace useParams types with useRequiredPathParam

* refactor: replace NavLink activeStyle with callback

* refactor: fix matchPath arg order

* refactor: Remove unused link state

* refactor: delete broken snapshot test

* refactor: render 404 page without redirect

* refactor: normalize path parameter names

* refactor: fix Route component usage
2022-05-05 13:42:18 +02:00

47 lines
1.3 KiB
TypeScript

import { Button, Typography } from '@mui/material';
import { useNavigate } from 'react-router';
import { ReactComponent as LogoIcon } from 'assets/icons/logoBg.svg';
import { useStyles } from './NotFound.styles';
const NotFound = () => {
const navigate = useNavigate();
const { classes: styles } = useStyles();
const onClickHome = () => {
navigate('/');
};
const onClickBack = () => {
navigate(-1);
};
return (
<div className={styles.container}>
<div>
<LogoIcon className={styles.logo} />
<div className={styles.content}>
<Typography variant="h1" style={{ fontSize: '2rem' }}>
Ooops. That's a page we haven't toggled on yet.
</Typography>
</div>
<div className={styles.buttonContainer}>
<Button
variant="contained"
color="primary"
onClick={onClickBack}
>
Go back
</Button>
<Button onClick={onClickHome} className={styles.homeButton}>
Go home
</Button>
</div>
</div>
</div>
);
};
export default NotFound;