-
Notifications
You must be signed in to change notification settings - Fork 627
Expand file tree
/
Copy pathApp.tsx
More file actions
65 lines (62 loc) · 1.49 KB
/
App.tsx
File metadata and controls
65 lines (62 loc) · 1.49 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import './App.css';
import './themes.css';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import { Landing } from './screens/Landing';
import { Game } from './screens/Game';
import Login from './screens/Login';
import { Suspense } from 'react';
import { RecoilRoot } from 'recoil';
import { Loader } from './components/Loader';
import { Layout } from './layout';
import { Settings } from './screens/Settings';
import { Themes } from './components/themes';
import { ThemesProvider } from './context/themeContext';
function App() {
return (
<div className="min-h-screen bg-bgMain text-textMain">
<RecoilRoot>
<Suspense fallback={<Loader />}>
<ThemesProvider>
<AuthApp />
</ThemesProvider>
</Suspense>
</RecoilRoot>
</div>
);
}
function AuthApp() {
return (
<BrowserRouter>
<Routes>
<Route
path="/"
element={
<Layout>
<Landing />
</Layout>
}
/>
<Route path="/login" element={<Login />} />
<Route
path="/game/:gameId"
element={
<Layout>
<Game />
</Layout>
}
/>
<Route
path="/settings"
element={
<Layout>
<Settings />
</Layout>
}
>
<Route path="themes" element={<Themes />} />
</Route>
</Routes>
</BrowserRouter>
);
}
export default App;