Skip to content

Commit

Permalink
feat: add a not-found catch-all route
Browse files Browse the repository at this point in the history
  • Loading branch information
rikhall1515 committed Apr 25, 2024
1 parent 17ce4e6 commit 059ef17
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
44 changes: 44 additions & 0 deletions app/(public)/[...not-found]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { FaArrowRight } from "react-icons/fa6";

import Logo from "@/components/logo";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";

export default async function NotFound() {
return (
<>
<section
className={cn(
"h-full min-h-[40rem] w-full",
"py-8 m:py-16 lg:py-24",
"relative overflow-x-hidden overflow-y-visible",
"bg-dot-black/[0.2] dark:bg-dot-white/[0.2]"
)}
>
<div
className={cn(
"min-h-[40rem] w-full max-w-[103rem]",
"pxPage mx-auto",
"flex flex-col items-center justify-center py-[7rem]"
)}
>
<Logo className="mb-12 h-[8rem] w-[8rem]" length={128} />
<span className="mb-2">404</span>
<h1 className="mb-6">
<span className="special">Page</span>{" "}
<span className="special">could</span>{" "}
<span className="special">not</span>{" "}
<span className="special">be</span>{" "}
<span className="special">found</span>
</h1>
<p>This page does not exist. Try starting again from the homepage.</p>
<Button asChild>
<a href="/">Back to Home</a>
<FaArrowRight />
</Button>
<div className="pointer-events-none absolute inset-0 flex items-center justify-center bg-background [mask-image:radial-gradient(ellipse_at_center,transparent_20%,black)]"></div>
</div>
</section>
</>
);
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"**/*.tsx",
".next/types/**/*.ts",
"lib/lighthouse/__tests__/index.test.mjs",
"lib/lighthouse/index.mjs"
"lib/lighthouse/index.mjs",
"app/(public)/[...not-found]"
],
"exclude": ["node_modules", ".next"]
}

0 comments on commit 059ef17

Please sign in to comment.