From fdb31c79edf6c0768a79567c4ee2042d6677bde6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 26 Nov 2025 19:46:05 +0000 Subject: [PATCH 1/8] Initial plan From 595e501ac49826d38a7ca3dcec8bb15891d1926e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 26 Nov 2025 19:55:48 +0000 Subject: [PATCH 2/8] Add custom 404 and error pages with consistent layout Co-authored-by: lfarci <31938998+lfarci@users.noreply.github.com> --- src/src/app/error.tsx | 43 +++++++++++++++++++++++++++++++++++++++ src/src/app/not-found.tsx | 23 +++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 src/src/app/error.tsx create mode 100644 src/src/app/not-found.tsx diff --git a/src/src/app/error.tsx b/src/src/app/error.tsx new file mode 100644 index 0000000..e69a5da --- /dev/null +++ b/src/src/app/error.tsx @@ -0,0 +1,43 @@ +"use client"; + +import { useEffect } from "react"; + +export default function Error({ + error, + reset, +}: { + error: Error & { digest?: string }; + reset: () => void; +}) { + useEffect(() => { + console.error(error); + }, [error]); + + return ( +
+

+ Oops! +

+

+ Something went wrong +

+

+ An unexpected error has occurred. Please try again or return to the home page. +

+
+ + +
+
+ ); +} diff --git a/src/src/app/not-found.tsx b/src/src/app/not-found.tsx new file mode 100644 index 0000000..0d9f661 --- /dev/null +++ b/src/src/app/not-found.tsx @@ -0,0 +1,23 @@ +import Link from "next/link"; + +export default function NotFound() { + return ( +
+

+ 404 +

+

+ Page Not Found +

+

+ Sorry, the page you are looking for does not exist or has been moved. +

+ + Back to Home + +
+ ); +} From ced59dca895ff61ffa70fa80bad37078e343abaa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 26 Nov 2025 19:58:09 +0000 Subject: [PATCH 3/8] Improve error page: use Next.js router and conditional logging Co-authored-by: lfarci <31938998+lfarci@users.noreply.github.com> --- src/src/app/error.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/src/app/error.tsx b/src/src/app/error.tsx index e69a5da..3999d1d 100644 --- a/src/src/app/error.tsx +++ b/src/src/app/error.tsx @@ -1,6 +1,7 @@ "use client"; import { useEffect } from "react"; +import { useRouter } from "next/navigation"; export default function Error({ error, @@ -9,8 +10,13 @@ export default function Error({ error: Error & { digest?: string }; reset: () => void; }) { + const router = useRouter(); + useEffect(() => { - console.error(error); + // Log errors in development for debugging + if (process.env.NODE_ENV === "development") { + console.error(error); + } }, [error]); return ( @@ -32,7 +38,7 @@ export default function Error({ Try Again - + ); } diff --git a/src/src/app/not-found.tsx b/src/src/app/not-found.tsx index 4c9183d..e8302c4 100644 --- a/src/src/app/not-found.tsx +++ b/src/src/app/not-found.tsx @@ -1,24 +1,19 @@ import Link from "next/link"; -import { Heading1, Heading2, Text } from "@/components/shared/typography"; +import ErrorMessage from "@/components/shared/ErrorMessage"; export default function NotFound() { return ( -
- - 404 - - - Page Not Found - - - Sorry, the page you are looking for does not exist or has been moved. - + Back to Home -
+ ); } diff --git a/src/src/components/shared/ErrorMessage.tsx b/src/src/components/shared/ErrorMessage.tsx new file mode 100644 index 0000000..b7cfffd --- /dev/null +++ b/src/src/components/shared/ErrorMessage.tsx @@ -0,0 +1,26 @@ +import { ReactNode } from "react"; +import { Heading1, Heading2, Text } from "@/components/shared/typography"; + +interface ErrorMessageProps { + title: string; + heading: string; + message: string; + children?: ReactNode; +} + +export default function ErrorMessage({ title, heading, message, children }: ErrorMessageProps) { + return ( +
+ + {title} + + + {heading} + + + {message} + + {children} +
+ ); +} From 077ad3e32f7810facfe3b2de5fe1450a07593cc9 Mon Sep 17 00:00:00 2001 From: Logan Farci Date: Sun, 30 Nov 2025 12:45:04 +0100 Subject: [PATCH 8/8] Refactor ErrorMessage component to use semantic HTML and typography styles --- src/src/components/shared/ErrorMessage.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/src/components/shared/ErrorMessage.tsx b/src/src/components/shared/ErrorMessage.tsx index b7cfffd..7685fa4 100644 --- a/src/src/components/shared/ErrorMessage.tsx +++ b/src/src/components/shared/ErrorMessage.tsx @@ -1,5 +1,7 @@ +"use client"; + import { ReactNode } from "react"; -import { Heading1, Heading2, Text } from "@/components/shared/typography"; +import { typographyStyles } from "@/components/shared/typography/core/styles"; interface ErrorMessageProps { title: string; @@ -10,17 +12,17 @@ interface ErrorMessageProps { export default function ErrorMessage({ title, heading, message, children }: ErrorMessageProps) { return ( -
- +
+

{title} - - +

+

{heading} - - +

+

{message} - +

{children} -
+ ); }