Skip to content

Commit bf42b60

Browse files
feat(web): add not found page
1 parent 37e4e9a commit bf42b60

File tree

3 files changed

+85
-7
lines changed

3 files changed

+85
-7
lines changed

.changeset/config.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,5 @@
77
"access": "public",
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
10-
"ignore": [
11-
"@better-t-stack/backend",
12-
"web"
13-
]
10+
"ignore": ["@better-t-stack/backend", "web"]
1411
}

apps/web/scripts/generate-analytics.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ async function generateAnalyticsData() {
188188
row["*.properties.examples.1"],
189189
].filter(Boolean);
190190
if (examples.length === 0) {
191-
examplesCounts["none"] = (examplesCounts["none"] || 0) + 1;
191+
examplesCounts.none = (examplesCounts.none || 0) + 1;
192192
} else {
193193
for (const example of examples) {
194194
examplesCounts[example] = (examplesCounts[example] || 0) + 1;
@@ -205,7 +205,7 @@ async function generateAnalyticsData() {
205205
row["*.properties.addons.5"],
206206
].filter(Boolean);
207207
if (addons.length === 0) {
208-
addonsCounts["none"] = (addonsCounts["none"] || 0) + 1;
208+
addonsCounts.none = (addonsCounts.none || 0) + 1;
209209
} else {
210210
for (const addon of addons) {
211211
addonsCounts[addon] = (addonsCounts[addon] || 0) + 1;
@@ -354,7 +354,7 @@ async function generateAnalyticsData() {
354354
monthlyTimeSeries: Object.entries(monthlyCounts)
355355
.map(([month, count]) => ({
356356
month,
357-
displayMonth: new Date(month + "-01").toLocaleDateString("en-US", {
357+
displayMonth: new Date(`${month}-01`).toLocaleDateString("en-US", {
358358
month: "short",
359359
year: "numeric",
360360
}),

apps/web/src/app/not-found.tsx

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
"use client";
2+
3+
import { FileX, Home, Terminal } from "lucide-react";
4+
import Link from "next/link";
5+
6+
export default function NotFound() {
7+
return (
8+
<div className="mx-auto min-h-svh max-w-[1280px]">
9+
<main className="mx-auto px-4 pt-12">
10+
<div className="mb-8">
11+
<div className="mb-6 flex flex-wrap items-center justify-between gap-2 sm:flex-nowrap">
12+
<div className="flex items-center gap-2">
13+
<Terminal className="h-4 w-4 text-primary" />
14+
<span className="font-bold text-lg sm:text-xl">
15+
ERROR_404.TXT
16+
</span>
17+
</div>
18+
<div className="h-px flex-1 bg-border" />
19+
<span className="text-muted-foreground text-xs">
20+
[PAGE NOT FOUND]
21+
</span>
22+
</div>
23+
</div>
24+
25+
<div className="mb-8 grid grid-cols-1 gap-4 lg:grid-cols-2">
26+
<div className="flex h-full flex-col justify-between rounded border border-border p-4">
27+
<div className="mb-4 flex items-center justify-between">
28+
<div className="flex items-center gap-2">
29+
<FileX className="h-4 w-4 text-primary" />
30+
<span className="font-semibold text-sm">ERROR_DETAILS</span>
31+
</div>
32+
<div className="rounded border border-border bg-muted/30 px-2 py-1 text-xs">
33+
404
34+
</div>
35+
</div>
36+
37+
<div className="space-y-3">
38+
<div className="flex items-center justify-between rounded border border-border p-3">
39+
<div className="flex items-center gap-2 font-mono text-sm">
40+
<span className="text-primary">$</span>
41+
<span className="text-foreground">
42+
Page not found in directory
43+
</span>
44+
</div>
45+
<div className="rounded border border-border bg-destructive/10 px-2 py-1 text-destructive text-xs">
46+
ERROR
47+
</div>
48+
</div>
49+
</div>
50+
</div>
51+
52+
<Link href="/">
53+
<div className="group flex h-full cursor-pointer flex-col justify-between rounded border border-border p-4 transition-colors hover:bg-muted/10">
54+
<div className="mb-4 flex items-center justify-between">
55+
<div className="flex items-center gap-2">
56+
<Home className="h-4 w-4 text-primary transition-transform group-hover:scale-110" />
57+
<span className="font-semibold text-sm">GO_HOME</span>
58+
</div>
59+
<div className="rounded border border-border bg-muted/30 px-2 py-1 text-xs">
60+
SAFE
61+
</div>
62+
</div>
63+
64+
<div className="space-y-3">
65+
<div className="flex items-center justify-between rounded border border-border p-3">
66+
<div className="flex items-center gap-2 text-sm">
67+
<Home className="h-4 w-4 text-primary" />
68+
<span className="text-foreground">Return to homepage</span>
69+
</div>
70+
<div className="rounded border border-border bg-muted/30 px-2 py-1 text-xs">
71+
NAVIGATE
72+
</div>
73+
</div>
74+
</div>
75+
</div>
76+
</Link>
77+
</div>
78+
</main>
79+
</div>
80+
);
81+
}

0 commit comments

Comments
 (0)