feat: 404 page

This commit is contained in:
Ruidy 2021-07-15 17:48:34 +02:00
parent 3343e3595e
commit 25d43fac6a
3 changed files with 18 additions and 3 deletions

View file

@ -4,14 +4,14 @@ import BillsPage from './pages/bills';
import HomePage from './pages/home';
import NotFoundPage from './pages/notFound';
type Config = {
type RouteConfig = {
path: string;
component: ({ ...props }: any) => JSX.Element;
exact?: boolean;
};
export default function Router() {
const routes: Config[] = [
const routes: RouteConfig[] = [
{
path: '/',
component: HomePage,

BIN
src/assets/notFound/404.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

View file

@ -1,7 +1,22 @@
import { Button, Col, Image, Row } from 'antd';
import { useHistory } from 'react-router-dom';
import NotFoundImage from '../assets/notFound/404.png';
import { withLayout } from '../layouts/main';
function NotFoundPage() {
return <div>Hoho</div>;
const history = useHistory();
return (
<Col>
<Row justify="center">
<Button size="large" type="link" onClick={() => history.push('/')}>
Go Back to Safety
</Button>
</Row>
<Row justify="center">
<Image src={NotFoundImage} preview={false} width={800} />
</Row>
</Col>
);
}
export default withLayout(NotFoundPage);