From c7c6b6959019f1de331b151df9fc0e735cbc0e5c Mon Sep 17 00:00:00 2001 From: PrathamX595 Date: Sun, 2 Jun 2024 20:54:35 +0530 Subject: [PATCH] frontend: added error page added an error page which will be rendered whenever an unknown route will be accessed Fixes: #21 --- backend/src/types.d.ts | 4 ++++ frontend/src/pages/Error.tsx | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/backend/src/types.d.ts b/backend/src/types.d.ts index 4f21a45..0ac9c89 100644 --- a/backend/src/types.d.ts +++ b/backend/src/types.d.ts @@ -27,6 +27,10 @@ type EventResult = { message: string; }; +declare global { + type GameEngine = import('./engine').GameEngine; +} + type GameEventType = 'DRAW_CARD' | 'THROW_CARD'; type GameEvent = diff --git a/frontend/src/pages/Error.tsx b/frontend/src/pages/Error.tsx index 7a93fd7..607e46e 100644 --- a/frontend/src/pages/Error.tsx +++ b/frontend/src/pages/Error.tsx @@ -2,10 +2,17 @@ import { Link } from 'react-router-dom'; function Error() { return ( -
- This page does not exist! - Go back to homepage -
+ <> +
+
+

404

+
+
Oops! Looks like there's an error
+
+ Back to Home +
+
+ ); }