mirror of
https://github.com/rjNemo/melon_frontend
synced 2026-06-06 02:16:45 +00:00
feat: 404 page
This commit is contained in:
parent
3343e3595e
commit
25d43fac6a
3 changed files with 18 additions and 3 deletions
|
|
@ -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
BIN
src/assets/notFound/404.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 103 KiB |
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue