-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.jsx
More file actions
37 lines (33 loc) · 1.13 KB
/
Copy pathApp.jsx
File metadata and controls
37 lines (33 loc) · 1.13 KB
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
import React, { useEffect, useState } from "react";
import { Routes, Route } from "react-router-dom";
import Navbar from "./components/Navbar.jsx";
import Footer from "./components/Footer.jsx";
import LoadingScreen from "./components/LoadingScreen.jsx";
import Home from "./pages/Home.jsx";
import Workshop from "./pages/Workshop.jsx";
import PatientSimulationPage from "./pages/PatientSimulationPage.jsx";
import Cases from "./pages/Cases.jsx";
import About from "./pages/About.jsx";
export default function App() {
const [loading, setLoading] = useState(true);
useEffect(() => {
const t = setTimeout(() => setLoading(false), 1900);
return () => clearTimeout(t);
}, []);
if (loading) return <LoadingScreen />;
return (
<>
<Navbar />
<main>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/workshop" element={<Workshop />} />
<Route path="/simulation/*" element={<PatientSimulationPage />} />
<Route path="/cases" element={<Cases />} />
<Route path="/about" element={<About />} />
</Routes>
</main>
<Footer />
</>
);
}