35 lines
976 B
TypeScript
35 lines
976 B
TypeScript
import React from "react";
|
|
import ReactDOM from "react-dom/client";
|
|
import SettingsPage from "./Pages/Settings.tsx";
|
|
import HomePage from "./Pages/Home.tsx";
|
|
import "./index.css";
|
|
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
import LoginPage from "./Pages/LoginPage.tsx";
|
|
import YourProjectsPage from "./Pages/YourProjectsPage.tsx";
|
|
import UserProjectPage from "./Pages/UserPages/UserProjectPage.tsx";
|
|
|
|
// This is where the routes are mounted
|
|
const router = createBrowserRouter([
|
|
{
|
|
path: "/",
|
|
element: <LoginPage />,
|
|
},
|
|
{
|
|
path: "/your-projects",
|
|
element: <YourProjectsPage />,
|
|
},
|
|
{
|
|
path: "/project",
|
|
element: <UserProjectPage />,
|
|
},
|
|
]);
|
|
|
|
// Semi-hacky way to get the root element
|
|
const root = document.getElementById("root") ?? document.createElement("div");
|
|
|
|
// Render the router at the root
|
|
ReactDOM.createRoot(root).render(
|
|
<React.StrictMode>
|
|
<RouterProvider router={router} />
|
|
</React.StrictMode>,
|
|
);
|