-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.jsx
48 lines (46 loc) · 1.85 KB
/
app.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React from "react";
import { createRoot } from "react-dom/client";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import { ProtectedRoute, SessionProvider } from "./src/services/auth";
import Login from "./src/Pages/Login";
import HomePage from "./src/Pages/Homepage";
import WorkoutsList from "./src/Pages/WorkoutsList";
import WorkoutUpdate from "./src/Pages/WorkoutUpdate";
import WorkoutExecution from "./src/Pages/WorkoutExecution";
import WorkoutCreate from "./src/Pages/WorkoutCreate/WorkoutCreate";
import NotFound from "./src/Pages/NotFound";
const root = createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<BrowserRouter>
<SessionProvider>
<Routes>
<Route path="/" element={<ProtectedRoute />}>
<Route
path=""
element={<HomePage />}
/>
<Route
path="workouts"
element={<WorkoutsList />}
/>
<Route
path="workouts/new"
element={<WorkoutCreate />}
/>
<Route
path="workouts/:workoutId/edit"
element={<WorkoutUpdate />}
/>
<Route
path="workouts/:workoutId"
element={<WorkoutExecution />}
/>
</Route>
<Route path="/login" element={<Login />} />
<Route path="*" element={<NotFound />} />
</Routes>
</SessionProvider>
</BrowserRouter>
</React.StrictMode>
);