diff --git a/apps/frontend/src/App.tsx b/apps/frontend/src/App.tsx index c5334c769..12b9fe70e 100644 --- a/apps/frontend/src/App.tsx +++ b/apps/frontend/src/App.tsx @@ -1,7 +1,11 @@ import { lazy } from "react"; import { ApolloClient, ApolloProvider, InMemoryCache } from "@apollo/client"; -import { RouterProvider, createBrowserRouter } from "react-router-dom"; +import { + RouterProvider, + createBrowserRouter, + redirect, +} from "react-router-dom"; import { ThemeProvider } from "@repo/theme"; @@ -34,6 +38,7 @@ const Compare = lazy(() => import("@/app/Schedule/Comparison")); const Manage = lazy(() => import("@/app/Schedule/Editor")); const Schedules = lazy(() => import("@/app/Schedules")); const Map = lazy(() => import("@/app/Map")); +const Plans = lazy(() => import("@/app/Plans")); const router = createBrowserRouter([ { @@ -59,6 +64,10 @@ const router = createBrowserRouter([ element: , path: "compare/:comparisonId?", }, + { + path: "*", + loader: () => redirect("."), + }, ], }, { @@ -107,6 +116,10 @@ const router = createBrowserRouter([ element: , path: "grades", }, + { + path: "*", + loader: () => redirect("."), + }, ], }, { @@ -129,18 +142,30 @@ const router = createBrowserRouter([ element: , path: "grades", }, + { + path: "*", + loader: () => redirect("."), + }, ], }, { element: , path: "schedules", }, + { + element: , + path: "plans", + }, { element: , - path: "plan", + path: "plans/:planId", }, ], }, + { + path: "*", + loader: () => redirect("/"), + }, ]); const client = new ApolloClient({ diff --git a/apps/frontend/src/app/Plans/index.tsx b/apps/frontend/src/app/Plans/index.tsx new file mode 100644 index 000000000..03ccec562 --- /dev/null +++ b/apps/frontend/src/app/Plans/index.tsx @@ -0,0 +1,3 @@ +export default function Plans() { + return <>; +}