mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-23 23:41:52 +08:00
feat: add more page
This commit is contained in:
+13
-3
@@ -1,8 +1,10 @@
|
||||
import { createBrowserRouter } from "react-router-dom";
|
||||
import RootLayout from "@/components/layouts/root-layout";
|
||||
import { env } from "@/config";
|
||||
import IndexPage from "@/pages";
|
||||
import MemShellPage from "@/pages/memshell";
|
||||
import { FormSchema } from "@/types/schema";
|
||||
import { createBrowserRouter } from "react-router-dom";
|
||||
import DetectionPage from "./pages/detection";
|
||||
import MemShellPartyLandingPage from "./pages/landing";
|
||||
|
||||
// Function to parse URL parameters into form default values
|
||||
const parseUrlParams = (searchParams: URLSearchParams): Partial<FormSchema> => {
|
||||
@@ -48,12 +50,20 @@ export const router = createBrowserRouter(
|
||||
children: [
|
||||
{
|
||||
index: true,
|
||||
element: <IndexPage />,
|
||||
element: <MemShellPartyLandingPage />,
|
||||
},
|
||||
{
|
||||
path: "memshell",
|
||||
element: <MemShellPage />,
|
||||
loader: ({ request }) => {
|
||||
const url = new URL(request.url);
|
||||
return parseUrlParams(url.searchParams);
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "detection",
|
||||
element: <DetectionPage />,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user