Skip to content

Commit

Permalink
Merge pull request #71 from Quiddlee/feat/add_404_page
Browse files Browse the repository at this point in the history
Feat/add 404 page
  • Loading branch information
Quiddlee authored Jan 6, 2024
2 parents 2e87d56 + acb45bd commit 745bee8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/pages/Page404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Link } from 'react-router-dom';

import ROUTES from '@/shared/constants/routes';

const Page404 = () => {
return (
<section className="flex h-full w-full items-center justify-center">
<div className="mx-4 w-full max-w-[500px] rounded-md bg-surface-container p-8 text-center text-xl text-on-surface">
<p className="leading-10">
The route you are trying to reach does not exist <span className="text-4xl">🤷‍♂️</span>
</p>
<p>
Try to go{' '}
<Link className="text-primary" to={ROUTES.WELCOME_PAGE}>
Home
</Link>{' '}
instead
</p>
</div>
</section>
);
};

export default Page404;
5 changes: 5 additions & 0 deletions src/router/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createHashRouter } from 'react-router-dom';
import ErrorFallback from '@/components/ErrorFallback/ErrorFallback';
import MainLayout from '@/layouts/MainLayout';
import LoginPage from '@/pages/LoginPage';
import Page404 from '@/pages/Page404';
import SettignsPage from '@/pages/SettingsPage';
import SignUpPage from '@/pages/SignUpPage';
import WelcomePage from '@/pages/WelcomePage';
Expand Down Expand Up @@ -66,6 +67,10 @@ export const routes = [
// </AuthAllowedOnly>
),
},
{
path: '*',
element: <Page404 />,
},
],
},
];
Expand Down

0 comments on commit 745bee8

Please sign in to comment.