From 73c6a7a0a41119dd7a7504531110fc26a97e3323 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Tue, 09 Nov 2021 23:25:49 +0000 Subject: [PATCH] Add 404 page to chartered-frontend --- chartered-frontend/src/index.tsx | 4 ++++ chartered-frontend/src/pages/NotFound.tsx | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/chartered-frontend/src/index.tsx b/chartered-frontend/src/index.tsx index 9cf29b5..0d755e4 100644 --- a/chartered-frontend/src/index.tsx +++ a/chartered-frontend/src/index.tsx @@ -28,6 +28,7 @@ import { backgroundFix } from "./overscrollColourFixer"; import Register from "./pages/Register"; import ListSessions from "./pages/sessions/ListSessions"; +import NotFound from "./pages/NotFound"; if ( window.matchMedia && @@ -76,6 +77,9 @@ } />} /> } />} /> + + } /> + } /> diff --git a/chartered-frontend/src/pages/NotFound.tsx b/chartered-frontend/src/pages/NotFound.tsx new file mode 100644 index 0000000..43fa46f 100644 --- /dev/null +++ a/chartered-frontend/src/pages/NotFound.tsx @@ -1,0 +1,32 @@ +import Nav from "../sections/Nav"; +import { useAuth } from "../useAuth"; + +export default function NotFound() { + return ( + <> + + +
+
+
+ Seems you've taken a wrong turn! The page you requested couldn't be + found. +
+
+
+ + ); +} + +function MaybeShowNav() { + const auth = useAuth(); + + if (!auth?.getAuthKey()) { + return <>; + } + + return