-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
51 lines (47 loc) · 1.7 KB
/
App.js
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
49
50
51
import { BrowserRouter, Routes, Route, HashRouter } from "react-router-dom";
import { Home } from "./Screens/Home";
import { SignUp } from "./Screens/SignUp";
import "./styles/App.css";
import { Room } from "./Screens/Room";
import { Join } from "./Screens/Join";
import { RecoilRoot } from "recoil";
import { Create } from "./Screens/Create";
import { JoinUrl } from "./Screens/JoinUrl";
import { APPROUTES } from "./AppConstants";
import { Login } from "./Screens/Login";
import { LoadingModal } from "./GlobalComponents/LoadingModal";
import { PrivateRoute } from "./GlobalComponents/PrivateRoute";
import { Dashboard } from "./Screens/Dashboard";
import { useEffect } from "react";
import { UploadModel } from "./Screens/UploadModel";
function App() {
return (
<RecoilRoot>
<HashRouter>
<LoadingModal />
<Routes>
<Route path="/" element={<Home />} />
<Route path={APPROUTES.dashboard} element={<Dashboard />} />
<Route path={APPROUTES.join} element={<Join />} />
<Route path={APPROUTES.joinByUrl} element={<JoinUrl />} />
<Route
path={APPROUTES.upload}
element={
<PrivateRoute to={<UploadModel />} errorRedirect={APPROUTES.home} />
}
/>
<Route
path={APPROUTES.create}
element={
<PrivateRoute to={<Create />} errorRedirect={APPROUTES.home} />
}
/>
<Route path={APPROUTES.room} element={<Room />} />
<Route path={APPROUTES.signUp} element={<SignUp />} />
<Route path={APPROUTES.login} element={<Login />} />
</Routes>
</HashRouter>
</RecoilRoot>
);
}
export default App;