Skip to content

Commit

Permalink
Merge pull request #12 from Real-Dev-Squad/setup/routing
Browse files Browse the repository at this point in the history
Setup: Routing in app
  • Loading branch information
lakshayman authored Dec 5, 2024
2 parents d4d4414 + 94006a3 commit 7d7a6ce
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react-dom": "^18.3.1",
"react-router-dom": "^6.28.0"
},
"devDependencies": {
"@eslint/js": "^9.14.0",
Expand Down
34 changes: 34 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import './App.css';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import Navbar from './components/navbar';
import FeatureFlagList from './pages/FeatureFlagList';
import FeatureFlagDetails from './pages/FeatureFlagDetails';

const App = () => {
return (
<>
<BrowserRouter>
<Navbar />
</>
<Routes>
<Route path="/featureFlag" element={<FeatureFlagList />} />
<Route path="/featureFlag/:id" element={<FeatureFlagDetails />} />
</Routes>
</BrowserRouter>
);
};

Expand Down
15 changes: 15 additions & 0 deletions src/pages/FeatureFlagDetails.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import { useParams } from 'react-router-dom';

const FeatureFlagDetails: React.FC = () => {
const { id } = useParams();

return (
<div className="container mx-auto mt-20 p-4">
<h1 className="mb-4 text-2xl font-bold">Feature Flag Details</h1>
<p>Feature Flag ID: {id}</p>
</div>
);
};

export default FeatureFlagDetails;
10 changes: 10 additions & 0 deletions src/pages/FeatureFlagList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
const FeatureFlagList: React.FC = () => {
return (
<div className="container mx-auto mt-20 p-4">
<h1 className="mb-4 text-2xl font-bold">Feature Flags</h1>
</div>
);
};

export default FeatureFlagList;

0 comments on commit 7d7a6ce

Please sign in to comment.