summaryrefslogtreecommitdiff
path: root/react/07-react-router/src/App.jsx
diff options
context:
space:
mode:
authorKamal Wickramanayake <kamal@inbox.lk>2026-07-01 20:41:10 +0530
committerKamal Wickramanayake <kamal@inbox.lk>2026-07-01 20:41:10 +0530
commit282a6af67b7ab8cce02f9c1e517008fbd775cf93 (patch)
treebbe9ca9a6b7808b55282860f5e3d25856afbb8e5 /react/07-react-router/src/App.jsx
parent6032e3533fa01cb722d750db13419406da344ae0 (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.jsx30
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