Skip to content

Commit

Permalink
Add a new 404 page, separate from error page
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferlund committed Aug 11, 2023
1 parent e5c03dc commit 24a148e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/frontend/src/navigation/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ActiveTokenSet, DecodedAccessToken } from '@/model/auth/auth';
import { MainLayout } from '../layouts/MainLayout';

const ActivatePage = React.lazy(() => import('@/pages/Activate/ActivatePage'));
const ErrorPage = React.lazy(() => import('@/pages/ErrorPage'));
const NotFoundPage = React.lazy(() => import('@/pages/NotFoundPage'));

export const Routes = (): JSX.Element => {
const [tokenSet, setTokenSet] = useRecoilState(ActiveTokenSet);
Expand All @@ -26,7 +26,7 @@ export const Routes = (): JSX.Element => {
<ActivatePage />
</Route>
<Route exact path="/404">
<ErrorPage error={{ message: 'Not found' }} />
<NotFoundPage />
</Route>

<MainLayout />
Expand Down
26 changes: 26 additions & 0 deletions packages/frontend/src/pages/NotFoundPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { faHeartCrack } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Link } from 'react-router-dom';

const NotFoundPage = (): JSX.Element => {
return (
<div className="flex items-center justify-center h-screen">
<div className="flex flex-col gap-4 text-2xl text-center">
<FontAwesomeIcon
icon={faHeartCrack}
size="3x"
className="text-themecolor-3"
/>
<div className="font-semibold">
We couldn&apos;t find what you were looking for
</div>
<div>
<Link to="/">Go to start page</Link>
</div>
</div>
</div>
);
};

// eslint-disable-next-line import/no-default-export
export default NotFoundPage;

0 comments on commit 24a148e

Please sign in to comment.