From e9cfadfb90e27bf193f792de9f0a2c4f1a2d62bc Mon Sep 17 00:00:00 2001 From: liangxu Date: Wed, 8 Jul 2026 12:16:30 +0800 Subject: [PATCH] refactor(ui): extract NotFoundPage into its own i18n-aware module Move the inline 404 component and its styles out of App.tsx into a dedicated NotFoundPage module, and localize its copy via i18n keys. Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/src/ui/App.tsx | 124 +------------------ frontend/src/ui/pages/NotFoundPage/index.css | 83 +++++++++++++ frontend/src/ui/pages/NotFoundPage/index.tsx | 123 ++++++++++++++++++ frontend/src/ui/styles.css | 82 +----------- 4 files changed, 209 insertions(+), 203 deletions(-) create mode 100644 frontend/src/ui/pages/NotFoundPage/index.css create mode 100644 frontend/src/ui/pages/NotFoundPage/index.tsx diff --git a/frontend/src/ui/App.tsx b/frontend/src/ui/App.tsx index 45b944e..17f2c5d 100644 --- a/frontend/src/ui/App.tsx +++ b/frontend/src/ui/App.tsx @@ -2,10 +2,11 @@ import { Loader2 } from "lucide-react"; import { useEffect, useState } from "react"; -import { openHome, readRoute, type AppRoute } from "@/application/route"; +import { readRoute, type AppRoute } from "@/application/route"; import { BrandMark } from "@/ui/components/BrandMark"; import { CanvasWorkspace } from "@/ui/pages/CanvasWorkspace"; import { HomePage } from "@/ui/pages/HomePage"; +import { NotFoundPage } from "@/ui/pages/NotFoundPage"; import { ProjectsRoutePage } from "@/ui/pages/ProjectsRoutePage"; import { useAuth } from "@/ui/auth/AuthProvider"; @@ -45,127 +46,6 @@ export function App() { return ; } -function NotFoundPage() { - const handleHome = () => { - openHome(); - }; - - return ( -
-
- -

404:页面未找到!

-

我们到处都找过了,但找不到您要找的页面。

- -
-
- ); -} - -function NotFoundMark() { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -} - function ProjectAuthPreview() { return (