Skip to content

Commit

Permalink
feat: Plan for plans
Browse files Browse the repository at this point in the history
  • Loading branch information
mathhulk committed Oct 16, 2024
1 parent c20082e commit 9c1e9bd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
29 changes: 27 additions & 2 deletions apps/frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -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([
{
Expand All @@ -59,6 +64,10 @@ const router = createBrowserRouter([
element: <Compare />,
path: "compare/:comparisonId?",
},
{
path: "*",
loader: () => redirect("."),
},
],
},
{
Expand Down Expand Up @@ -107,6 +116,10 @@ const router = createBrowserRouter([
element: <Course.Grades />,
path: "grades",
},
{
path: "*",
loader: () => redirect("."),
},
],
},
{
Expand All @@ -129,18 +142,30 @@ const router = createBrowserRouter([
element: <Class.Grades />,
path: "grades",
},
{
path: "*",
loader: () => redirect("."),
},
],
},
{
element: <Schedules />,
path: "schedules",
},
{
element: <Plans />,
path: "plans",
},
{
element: <Plan />,
path: "plan",
path: "plans/:planId",
},
],
},
{
path: "*",
loader: () => redirect("/"),
},
]);

const client = new ApolloClient({
Expand Down
3 changes: 3 additions & 0 deletions apps/frontend/src/app/Plans/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Plans() {
return <></>;
}

0 comments on commit 9c1e9bd

Please sign in to comment.