mirror of
https://github.com/certimate-go/certimate.git
synced 2026-06-13 21:01:32 +08:00
feat(ui): custom 404 page
This commit is contained in:
parent
3fec80f9d5
commit
3bd2bee321
12
ui/src/pages/ErrorLayout.tsx
Normal file
12
ui/src/pages/ErrorLayout.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
import { Outlet } from "react-router-dom";
|
||||
import { Layout } from "antd";
|
||||
|
||||
const ErrorLayout = ({ children }: { children?: React.ReactNode }) => {
|
||||
return (
|
||||
<Layout className="h-screen">
|
||||
<div className="relative">{children || <Outlet />}</div>
|
||||
</Layout>
|
||||
);
|
||||
};
|
||||
|
||||
export default ErrorLayout;
|
||||
@ -5,6 +5,7 @@ import AuthLayout from "./pages/AuthLayout";
|
||||
import CertificateList from "./pages/certificates/CertificateList";
|
||||
import ConsoleLayout from "./pages/ConsoleLayout";
|
||||
import Dashboard from "./pages/dashboard/Dashboard";
|
||||
import ErrorLayout from "./pages/ErrorLayout";
|
||||
import Login from "./pages/login/Login";
|
||||
import Settings from "./pages/settings/Settings";
|
||||
import SettingsAccount from "./pages/settings/SettingsAccount";
|
||||
@ -83,4 +84,17 @@ export const router = createHashRouter([
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "*",
|
||||
element: (
|
||||
<ErrorLayout>
|
||||
<div className="flex h-screen w-full flex-col items-center justify-center">
|
||||
<div className="flex flex-wrap items-center justify-center gap-x-4 gap-y-2">
|
||||
<h1>404</h1>
|
||||
<h2>This page could not be found.</h2>
|
||||
</div>
|
||||
</div>
|
||||
</ErrorLayout>
|
||||
),
|
||||
},
|
||||
]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user