feat: not found page (#1081)

* feat: style for not found page (#1078)

* chore: translation for not found page (#1078)

* feat: add not found page (#1078)

* chore: router for not found page (#1078)

* fix: typo
This commit is contained in:
Xi
2023-02-13 23:28:46 +08:00
committed by GitHub
parent 5455cb3164
commit 28405f6d24
5 changed files with 57 additions and 2 deletions

View File

@ -9,6 +9,7 @@ const Explore = lazy(() => import("../pages/Explore"));
const Home = lazy(() => import("../pages/Home"));
const MemoDetail = lazy(() => import("../pages/MemoDetail"));
const EmbedMemo = lazy(() => import("../pages/EmbedMemo"));
const NotFound = lazy(() => import("../pages/NotFound"));
const router = createBrowserRouter([
{
@ -110,6 +111,18 @@ const router = createBrowserRouter([
return null;
},
},
{
path: "*",
element: <NotFound />,
loader: async () => {
try {
await initialGlobalState();
} catch (error) {
// do nth
}
return null;
},
},
]);
export default router;