From f7a98183ca4bc4fa75ef6541fbf4b17c705ff718 Mon Sep 17 00:00:00 2001 From: ahmetselman Date: Sat, 14 Dec 2024 11:24:44 +0100 Subject: [PATCH 1/4] feat: configure error page --- src/app/error.tsx | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/app/error.tsx b/src/app/error.tsx index 6847fc17..e5588ec0 100644 --- a/src/app/error.tsx +++ b/src/app/error.tsx @@ -2,25 +2,34 @@ import { useEffect } from 'react'; -export default function Error({ error, reset }: { error: Error; reset: () => void }) { +import { CustomButton } from '@/components/Buttons/CustomButton'; +import { Topbar } from '@/components/Topbar/Topbar'; + +export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { useEffect(() => { // Log the error to an error reporting service /* eslint-disable no-console */ - console.error(error); }, [error]); return ( -
-

Something went wrong!

- +
+ +
+
+

An Error Occurred

+

Please try again or go back to the Home page.

+
+
+ reset()}> + Try again + + + + Go to Home page + + +
+
); } From 653fc44b855db8ec2fb0aa95d774fe5b47dbe95b Mon Sep 17 00:00:00 2001 From: ahmetselman Date: Sat, 14 Dec 2024 11:42:23 +0100 Subject: [PATCH 2/4] feat: not-found 404 --- src/app/not-found.tsx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/app/not-found.tsx diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx new file mode 100644 index 00000000..f9bcfbee --- /dev/null +++ b/src/app/not-found.tsx @@ -0,0 +1,25 @@ +'use client'; + +import { CustomButton } from '@/components/Buttons/CustomButton'; +import { Topbar } from '@/components/Topbar/Topbar'; + +export default function NotFound() { + return ( +
+ +
+
+

404 Not Found

+

Could not find the requested resource.

+
+ +
+
+ ); +} From ef631667ccd6160858a1cb8a2dc89ab3610a12f6 Mon Sep 17 00:00:00 2001 From: ahmetselman Date: Sat, 14 Dec 2024 11:45:30 +0100 Subject: [PATCH 3/4] feat: log error --- src/app/error.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/error.tsx b/src/app/error.tsx index e5588ec0..64f60e16 100644 --- a/src/app/error.tsx +++ b/src/app/error.tsx @@ -9,6 +9,7 @@ export default function Error({ error, reset }: { error: Error & { digest?: stri useEffect(() => { // Log the error to an error reporting service /* eslint-disable no-console */ + console.error(error); }, [error]); return ( From 77ceb47f3987291872610935a743ecd6a3d1b548 Mon Sep 17 00:00:00 2001 From: Lachezar Marinov <99186919+marinovl7@users.noreply.github.com> Date: Sun, 15 Dec 2024 14:57:14 +0100 Subject: [PATCH 4/4] Update not-found.tsx --- src/app/not-found.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index f9bcfbee..c3655215 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -9,8 +9,8 @@ export default function NotFound() {
-

404 Not Found

-

Could not find the requested resource.

+

Ooops

+

The requested page could not be found.