2024-02-13 14:47:36 +01:00
|
|
|
import React from "react";
|
|
|
|
import ReactDOM from "react-dom/client";
|
2024-03-06 11:14:08 +01:00
|
|
|
import SettingsPage from "./Pages/Settings.tsx";
|
|
|
|
import HomePage from "./Pages/Home.tsx";
|
2024-02-13 14:47:36 +01:00
|
|
|
import "./index.css";
|
2024-03-06 10:09:59 +01:00
|
|
|
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
2024-03-07 10:05:45 +01:00
|
|
|
import LoginPage from "./Pages/LoginPage.tsx";
|
|
|
|
import YourProjectsPage from "./Pages/YourProjectsPage.tsx";
|
|
|
|
import UserProjectPage from "./Pages/UserPages/UserProjectPage.tsx";
|
2024-03-06 10:09:59 +01:00
|
|
|
|
2024-03-06 11:14:08 +01:00
|
|
|
// This is where the routes are mounted
|
2024-03-06 10:09:59 +01:00
|
|
|
const router = createBrowserRouter([
|
|
|
|
{
|
|
|
|
path: "/",
|
2024-03-07 10:05:45 +01:00
|
|
|
element: <LoginPage />,
|
2024-03-06 11:14:08 +01:00
|
|
|
},
|
|
|
|
{
|
2024-03-07 10:05:45 +01:00
|
|
|
path: "/your-projects",
|
|
|
|
element: <YourProjectsPage />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/project",
|
|
|
|
element: <UserProjectPage />,
|
2024-03-06 10:09:59 +01:00
|
|
|
},
|
|
|
|
]);
|
2024-02-12 12:47:46 +01:00
|
|
|
|
2024-03-06 11:14:08 +01:00
|
|
|
// Semi-hacky way to get the root element
|
2024-02-13 14:47:36 +01:00
|
|
|
const root = document.getElementById("root") ?? document.createElement("div");
|
|
|
|
|
2024-03-06 11:14:08 +01:00
|
|
|
// Render the router at the root
|
2024-02-13 14:47:36 +01:00
|
|
|
ReactDOM.createRoot(root).render(
|
2024-02-12 12:47:46 +01:00
|
|
|
<React.StrictMode>
|
2024-03-06 10:09:59 +01:00
|
|
|
<RouterProvider router={router} />
|
2024-02-12 12:47:46 +01:00
|
|
|
</React.StrictMode>,
|
2024-02-13 14:47:36 +01:00
|
|
|
);
|