Skip to content

Commit c89c3b0

Browse files
committed
feat: error route update
1 parent b5bb130 commit c89c3b0

File tree

1 file changed

+54
-31
lines changed

1 file changed

+54
-31
lines changed

client/src/components/404.tsx

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,76 @@ const images404 = [
1212
'/coffybara404-4.png',
1313
];
1414

15-
const FourOhFour: React.FC = () => {
16-
const [randomImage, setRandomImage] = useState<string>('');
15+
const FourOhFour = () => {
16+
const [randomImage, setRandomImage] = useState('');
1717

1818
useEffect(() => {
19-
// Select a random image when component mounts
19+
// Select random image when component mounts
2020
const randomIndex = Math.floor(Math.random() * images404.length);
2121
setRandomImage(images404[randomIndex]);
2222
}, []);
2323

2424
return (
25-
<div
26-
className="flex min-h-screen flex-col items-center justify-center px-4 py-8 sm:px-6 md:px-8"
25+
<main
26+
className="flex h-screen w-full flex-col items-center justify-center"
2727
style={{
2828
backgroundColor: 'var(--background)',
29-
color: 'var(--foreground)'
29+
fontFamily: 'var(--font-sans)',
3030
}}
3131
>
32-
<h1
33-
className="mb-6 text-center text-2xl font-bold sm:mb-8 sm:text-3xl md:text-4xl lg:text-5xl"
34-
style={{
35-
color: 'var(--foreground)',
36-
fontFamily: 'var(--font-sans)'
37-
}}
38-
>
39-
404 - Oops, this is not what you were looking for.
40-
</h1>
41-
{randomImage && (
42-
<img
43-
src={randomImage}
44-
alt="Confused Coffybara"
45-
className="h-auto w-full max-w-xs sm:max-w-sm md:max-w-md lg:max-w-lg"
32+
{/* Large 404 Text with Overlaid Badge */}
33+
<div className="relative">
34+
<h1
35+
className="text-9xl font-extrabold tracking-widest"
36+
style={{ color: 'var(--foreground)' }}
37+
>
38+
404
39+
</h1>
40+
41+
{/* Rotated Badge positioned over the "0" */}
42+
<div
43+
className="absolute left-1/2 top-2/3 -translate-x-1/2 rotate-12 transform rounded px-2 py-1 text-sm"
4644
style={{
47-
borderRadius: 'var(--radius)',
48-
boxShadow: 'var(--shadow-lg)'
45+
backgroundColor: 'var(--primary)',
46+
color: 'var(--primary-foreground)',
47+
zIndex: 10,
4948
}}
50-
/>
49+
>
50+
Page Not Found
51+
</div>
52+
</div>
53+
54+
{/* Coffybara Image */}
55+
{randomImage && (
56+
<div className="mb-5 mt-8">
57+
<img
58+
src={randomImage}
59+
alt="Confused Coffybara"
60+
className="h-auto w-full max-w-xs sm:max-w-sm"
61+
/>
62+
</div>
5163
)}
52-
<p
53-
className="mt-4 text-center text-base sm:mt-6 sm:text-lg md:text-xl"
54-
style={{
55-
color: 'var(--muted-foreground)',
56-
fontFamily: 'var(--font-sans)'
57-
}}
64+
65+
{/* Description Text */}
66+
<p
67+
className="mx-auto mb-8 max-w-2xl px-4 text-center text-lg leading-relaxed sm:text-xl"
68+
style={{ color: 'var(--muted-foreground)' }}
5869
>
59-
Even our capybara is confused! Let's get you back on track.
70+
Don't worry, even the best explorers sometimes take unexpected detours.
71+
Let's get you back to where you need to be.
6072
</p>
61-
</div>
73+
74+
{/* Dashboard Link */}
75+
<div className="mt-5">
76+
<a
77+
href="/dashboard"
78+
className="text-lg font-medium"
79+
style={{ color: 'var(--foreground)' }}
80+
>
81+
Dashboard
82+
</a>
83+
</div>
84+
</main>
6285
);
6386
};
6487

0 commit comments

Comments
 (0)