-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
52 lines (49 loc) · 1.73 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
52
import Home from "./pages/home/Home";
import Login from "./pages/login/Login";
import List from "./pages/list/List";
import Single from "./pages/single/Single";
import New from "./pages/new/New";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import { productInputs, userInputs } from "./formSource";
import "./style/dark.scss";
import { useContext } from "react";
import { DarkModeContext } from "./context/darkModeContext";
function App() {
const { darkMode } = useContext(DarkModeContext);
return (
<div className={darkMode ? "app dark" : "app"}>
<BrowserRouter>
<Routes>
<Route path="/">
<Route index element={<Home />} />
<Route path="login" element={<Login />} />
<Route path="users">
<Route index element={<List />} />
{/* <Route path=":userId" element={<Single />} /> */}
<Route
path="new"
element={<New inputs={userInputs} title="Add New User" />}
/>
</Route><Route path="Stats">
<Route index element={<List />} />
{/* <Route path=":userId" element={<Single />} /> */}
<Route
path="new"
element={<New inputs={userInputs} title="Upload " />}
/>
</Route>
<Route path="Products">
<Route index element={<List />} />
{/* <Route path=":prodsuctId" element={<Single />} /> */}
<Route
path="new"
element={<New inputs={productInputs} title="Add New Product" />}
/>
</Route>
</Route>
</Routes>
</BrowserRouter>
</div>
);
}
export default App;