Skip to content

Commit 11a742f

Browse files
committed
add 404 page
1 parent 8547f39 commit 11a742f

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

app/routes.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ let $$default = Belt_Array.concatMany([
4747
})
4848
],
4949
stdlibRoutes,
50-
Server.routes("./routes/MdxRoute.mjs")
50+
Server.routes("./routes/MdxRoute.mjs"),
51+
[Routes.route("*", "./routes/NotFoundRoute.mjs")]
5152
]);
5253

5354
export {

app/routes.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ let default = [
2727
route("docs/manual/api/dom", "./routes/ApiRoute.mjs", ~options={id: "api-dom"}),
2828
...stdlibRoutes,
2929
...mdxRoutes("./routes/MdxRoute.mjs"),
30+
route("*", "./routes/NotFoundRoute.mjs"),
3031
]

app/routes/NotFoundRoute.res

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@react.component
2+
let default = () => {
3+
<div className="pt-36 text-center flex flex-col gap-6 text-gray-80 w-fit mx-auto">
4+
<h1 className="hl-title"> {React.string("404")} </h1>
5+
<h2 className="text-32"> {React.string("Page Not Found")} </h2>
6+
<p> {React.string("Oops! The page you're looking for doesn't exist.")} </p>
7+
<a href="/" className=" text-fire no-underline hover:underline">
8+
{React.string("Return home")}
9+
</a>
10+
</div>
11+
}

0 commit comments

Comments
 (0)