Skip to content

Commit 1867700

Browse files
authored
Merge pull request #6 from tom-draper/dashboard-refactor
Fix user trend counting and optimize filtered data handling
2 parents 74d2d71 + cdd44e4 commit 1867700

File tree

17 files changed

+163
-629
lines changed

17 files changed

+163
-629
lines changed

dashboard/app/error.tsx

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
'use client';
2+
3+
import { useEffect } from 'react';
4+
5+
export default function Error({
6+
error,
7+
reset,
8+
}: {
9+
error: Error & { digest?: string };
10+
reset: () => void;
11+
}) {
12+
useEffect(() => {
13+
console.error(error);
14+
}, [error]);
15+
16+
return (
17+
<div style={{
18+
display: 'flex',
19+
flexDirection: 'column',
20+
alignItems: 'center',
21+
justifyContent: 'center',
22+
minHeight: '100vh',
23+
background: 'var(--background)',
24+
color: 'var(--text)',
25+
fontFamily: 'Inter, Helvetica, Arial, sans-serif',
26+
gap: '1rem',
27+
padding: '2rem',
28+
textAlign: 'center',
29+
}}>
30+
<h1 style={{ fontSize: '1.5rem', fontWeight: 600, color: 'var(--bold-text)' }}>
31+
Something went wrong
32+
</h1>
33+
<p style={{ color: 'var(--text-muted)', fontSize: '0.95rem', maxWidth: '400px' }}>
34+
{error.message || 'An unexpected error occurred.'}
35+
</p>
36+
{error.digest && (
37+
<p style={{ color: 'var(--text-muted2)', fontSize: '0.8rem', fontFamily: 'monospace' }}>
38+
Error ID: {error.digest}
39+
</p>
40+
)}
41+
<button
42+
onClick={reset}
43+
style={{
44+
marginTop: '0.5rem',
45+
padding: '0.5rem 1.25rem',
46+
background: 'var(--highlight)',
47+
color: 'var(--inverted-text)',
48+
border: 'none',
49+
borderRadius: 'var(--border-radius)',
50+
fontSize: '0.9rem',
51+
fontWeight: 600,
52+
cursor: 'pointer',
53+
}}
54+
>
55+
Try again
56+
</button>
57+
</div>
58+
);
59+
}

dashboard/app/globals.css

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,30 @@
77
}
88

99
:root {
10-
/* --background: #ffffff;
11-
--foreground: #171717; */
12-
--background: #0a0a0a;
1310
--foreground: #ededed;
1411
--nginx-green: #009400;
1512
--other-green: rgb(46, 204, 113);
16-
--highlight: rgb(46, 204, 113);
17-
--highlight: rgb(26, 240, 115);
1813
--highlight: #1af073;
19-
--background: rgb(0, 0, 0);
2014
--background: #08090a;
21-
--card-background: rgb(13, 13, 13);
22-
--card-background: rgb(14, 14, 14);
2315
--card-background: #101213;
2416
--inverted-text: black;
2517
--bold-text: white;
26-
--text: white;
2718
--text: #F7F8F8;
2819
--text-tinted: #ededed;
2920
--text-muted: gray;
3021
--text-muted2: #5d5d5d;
3122
--text-muted3: #666;
3223
--text-muted4: #8a8f98;
33-
--border-color: rgb(22, 22, 22);
34-
--border-color: rgb(34, 34, 34);
3524
--border-color: rgb(35, 37, 42);
3625
--border-radius: 0.3rem;
3726
--hover-background: rgb(34, 34, 34);
38-
--warn: #ff644b;
39-
--warn: #ffaa4b;
4027
--warn: rgb(255, 170, 75);
4128
--error: #ff5050;
42-
--info: #00bfff;
4329
--info: rgb(0, 191, 255);
4430
}
4531

4632
@media (prefers-color-scheme: light) {
4733
:root {
48-
--background: #0a0a0a;
49-
--foreground: #ededed;
5034
--background: #ffffff;
5135
--foreground: #171717;
5236
}
@@ -59,9 +43,6 @@ body {
5943
}
6044

6145
.level {
62-
background: var(--highlight);
63-
background: oklch(0.928 0.006 264.531);
64-
background: oklch(0.967 0.003 264.542);
6546
background: rgb(255, 80, 80);
6647
}
6748

@@ -207,7 +188,6 @@ body {
207188

208189

209190
.level-none {
210-
background: oklch(0.967 0.003 264.542);
211191
background: rgb(49, 49, 49);
212192
}
213193

dashboard/app/icon-old.svg

Lines changed: 0 additions & 22 deletions
This file was deleted.

dashboard/app/not-found.tsx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import Link from 'next/link';
2+
3+
export default function NotFound() {
4+
return (
5+
<div style={{
6+
display: 'flex',
7+
flexDirection: 'column',
8+
alignItems: 'center',
9+
justifyContent: 'center',
10+
minHeight: '100vh',
11+
background: 'var(--background)',
12+
color: 'var(--text)',
13+
fontFamily: 'Inter, Helvetica, Arial, sans-serif',
14+
gap: '1rem',
15+
padding: '2rem',
16+
textAlign: 'center',
17+
}}>
18+
<h1 style={{ fontSize: '4rem', fontWeight: 700, color: 'var(--highlight)', lineHeight: 1 }}>
19+
404
20+
</h1>
21+
<h2 style={{ fontSize: '1.25rem', fontWeight: 600, color: 'var(--bold-text)' }}>
22+
Page not found
23+
</h2>
24+
<p style={{ color: 'var(--text-muted)', fontSize: '0.95rem', maxWidth: '400px' }}>
25+
The page you are looking for does not exist or has been moved.
26+
</p>
27+
<Link
28+
href="/dashboard"
29+
style={{
30+
marginTop: '0.5rem',
31+
padding: '0.5rem 1.25rem',
32+
background: 'var(--highlight)',
33+
color: 'var(--inverted-text)',
34+
borderRadius: 'var(--border-radius)',
35+
fontSize: '0.9rem',
36+
fontWeight: 600,
37+
textDecoration: 'none',
38+
display: 'inline-block',
39+
}}
40+
>
41+
Back to dashboard
42+
</Link>
43+
</div>
44+
);
45+
}

0 commit comments

Comments
 (0)