-
+
404
-
-
+
+
Page Not Found
-
-
+
+
Sorry, the page you are looking for does not exist or has been moved.
-
+
Date: Sat, 29 Nov 2025 10:43:02 +0000
Subject: [PATCH 7/8] Refactor error pages to use shared ErrorMessage component
Co-authored-by: lfarci <31938998+lfarci@users.noreply.github.com>
---
src/src/app/error.tsx | 19 ++++++----------
src/src/app/not-found.tsx | 19 ++++++----------
src/src/components/shared/ErrorMessage.tsx | 26 ++++++++++++++++++++++
3 files changed, 40 insertions(+), 24 deletions(-)
create mode 100644 src/src/components/shared/ErrorMessage.tsx
diff --git a/src/src/app/error.tsx b/src/src/app/error.tsx
index 2db4db2..33d9667 100644
--- a/src/src/app/error.tsx
+++ b/src/src/app/error.tsx
@@ -2,7 +2,7 @@
import { useEffect } from "react";
import { useRouter } from "next/navigation";
-import { Heading1, Heading2, Text } from "@/components/shared/typography";
+import ErrorMessage from "@/components/shared/ErrorMessage";
export default function GlobalError({
error,
@@ -21,16 +21,11 @@ export default function GlobalError({
}, [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
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 (
-
-
+
-
+
+
{heading}
-
-
+
+
{message}
-
+
{children}
-
+
);
}