-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
26 lines (25 loc) · 914 Bytes
/
Copy pathApp.js
File metadata and controls
26 lines (25 loc) · 914 Bytes
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
import "bootstrap/dist/css/bootstrap.min.css";
import Login from "./Components/Login/Login";
import { Routes, Route } from "react-router-dom";
import { useSelector } from "react-redux";
import AddUser from "./Components/User/AddUser";
import ListUser from "./Components/User/ListUser";
import EditUser from "./Components/User/EditUser";
import Header from "./Components/Header/Header";
function App() {
const { isLogged } = useSelector((state) => state);
const localData = localStorage.getItem("token");
return (
<div className="container">
{localData ? <Header /> : ""}
{/* {!isLogged ? <Login /> : ""} */}
<Routes>
<Route path="/" element={<Login />} />
<Route path="/list" element={<ListUser />} />
<Route path="/create" element={<AddUser />} />
<Route path="/edit/:id" element={<EditUser />} />
</Routes>
</div>
);
}
export default App;