diff options
| author | Kamal Wickramanayake <kamal@inbox.lk> | 2026-07-01 20:41:10 +0530 |
|---|---|---|
| committer | Kamal Wickramanayake <kamal@inbox.lk> | 2026-07-01 20:41:10 +0530 |
| commit | 282a6af67b7ab8cce02f9c1e517008fbd775cf93 (patch) | |
| tree | bbe9ca9a6b7808b55282860f5e3d25856afbb8e5 /react/07-react-router/src/App.jsx | |
| parent | 6032e3533fa01cb722d750db13419406da344ae0 (diff) | |
Added React Router sample app
Diffstat (limited to 'react/07-react-router/src/App.jsx')
| -rw-r--r-- | react/07-react-router/src/App.jsx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/react/07-react-router/src/App.jsx b/react/07-react-router/src/App.jsx new file mode 100644 index 0000000..ab7d824 --- /dev/null +++ b/react/07-react-router/src/App.jsx @@ -0,0 +1,30 @@ +import { Routes, Route } from "react-router"; + +import Navbar from "./components/Navbar"; +import HomePage from "./pages/HomePage" +import AboutPage from "./pages/AboutPage" +import AuthLayout from "./features/auth/layouts/AuthLayout" +import Login from "./features/auth/components/Login" +import Register from "./features/auth/components/Register" +import PostList from "./features/posts/components/PostList" + +function App() { + return ( + <div className="app"> + <Navbar/> + + <Routes> + <Route index element={<HomePage />} /> + <Route path="about" element={<AboutPage />} /> + <Route path="Posts" element={<PostList />} /> + + <Route element={<AuthLayout />}> + <Route path="login" element={<Login />} /> + <Route path="register" element={<Register />} /> + </Route> + </Routes> + </div> + ) +} + +export default App |
