Skip to content

Commit b93bcb8

Browse files
authored
Merge pull request HolodexNet#803 from meiamsome/feat/next-not-found-page
FEAT: Split out NotFound page to its own component (next)
2 parents 4448e7b + a32f9e6 commit b93bcb8

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Button } from "@/shadcn/ui/button";
2+
import { Helmet } from "react-helmet-async";
3+
import { useTranslation } from "react-i18next";
4+
import { Link } from "react-router-dom";
5+
6+
export default function NotFound() {
7+
const { t } = useTranslation();
8+
9+
return (
10+
<>
11+
<Helmet>
12+
<title>{t("views.notFound.title")} - Holodex</title>
13+
</Helmet>
14+
<div className="text-center">
15+
<h1 className="my-10 text-xl font-bold">{t("views.notFound.title")}</h1>
16+
<Button asChild variant="secondary">
17+
<Link to="/">{t("views.notFound.back")}</Link>
18+
</Button>
19+
</div>
20+
</>
21+
);
22+
}

packages/react/src/locales/en/ui.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ views:
298298
dateuploadedLatestFirst: Upload date, latest first
299299
dateuploadedEarliestFirst: Upload date, earliest first
300300
notFound:
301-
title: Content not found
301+
title: Content Not Found
302302
back: Return Home
303303
search:
304304
sort:

packages/react/src/routes/router.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ const Watch = lazy(() =>
101101
const ResetClientPage = lazy(() =>
102102
import("./debug").then((module) => ({ default: module.ResetClientPage })),
103103
);
104+
const NotFound = lazy(() => import("@/components/common/NotFound"));
104105
const Playlist = lazy(() => import("./playlist"));
105106
const Multiview = lazy(() =>
106107
import("./multiview/multiview").then((module) => ({
@@ -174,6 +175,6 @@ export const routes = (
174175
<Route path="watch/:id" Component={Watch} />
175176
<Route path="debug" Component={ResetClientPage} />
176177
<Route path="debug/run" element={<div>Debug Run</div>} />
177-
<Route path="*" element={<div>Not found</div>} />
178+
<Route path="*" Component={NotFound} />
178179
</Route>
179180
);

0 commit comments

Comments
 (0)