import Home from "../src/component/Home/Home/Home"; | |
import { Routes, Route } from "react-router-dom"; | |
import React, { createContext } from "react"; | |
import About from "./component/Home/About/About"; | |
import Dashboard from "./component/Dashoboard/Dashboard/Dashboard"; | |
import LoginModal from "./component/Login/LoginModal"; | |
import PrivateRoute from "./component/Login/PrivateRoute"; | |
import NotFound from "./component/NotFound"; | |
export const UserContext = createContext(); | |
const App = () => { | |
return ( | |
<div> | |
<Routes> | |
<Route path="/" element={<Home />} /> | |
<Route path="/about" element={<About />} /> | |
<Route path="/login" element={<LoginModal />} /> | |
<Route | |
path="/dashboard/*" | |
element={ | |
<PrivateRoute redirectTo="/login"> | |
<Dashboard /> | |
</PrivateRoute> | |
} | |
/> | |
<Route path="*" element={<NotFound />} /> | |
</Routes> | |
</div> | |
); | |
}; | |
export default App; | |