Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature ticket 138 routing configuration #142

Merged
merged 3 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion frontend/web-app/src/Components/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import React from 'react'
import { Link, Outlet } from 'react-router-dom';

function NavBar() {
return (
<div>NavBar</div>
<div>
<div>
<Link to="/">Home</Link>
<Link to="/about">About</Link>
<Link to="/faq">FAQ</Link>
</div>
<Outlet />
</div>
)
};

Expand Down
37 changes: 27 additions & 10 deletions frontend/web-app/src/Components/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import PlantDetailPage from "../Pages/PlantDetailPage";
import AboutPage from "../Pages/AboutPage";
import FaqPage from "../Pages/FaqPage";
import ErrorPage from "../Pages/ErrorPage";
import NavBar from "./NavBar";
import SignUpPage from "../Pages/SignUpPage";
import DisplayPage from "../Pages/DisplayPage";

const router = createBrowserRouter([
{
Expand All @@ -15,21 +18,35 @@ const router = createBrowserRouter([
element: <LoginPage/>,
},
{
path: '/',
element: <HomePage/>,
path: '/signup',
element: <SignUpPage />,
},
{
path: '/plant_detail',
element: <PlantDetailPage/>,
path: '/display',
element: <DisplayPage />
},
{
path: '/about',
element: <AboutPage />,
path: '/',
element: <NavBar />,
children: [
{
path: '/',
element: <HomePage/>,
},
{
path: '/plant_detail',
element: <PlantDetailPage/>,
},
{
path: '/about',
element: <AboutPage />,
},
{
path: '/faq',
element: <FaqPage />,
}
]
},
{
path: '/faq',
element: <FaqPage />,
}
]);

function Provider() {
Expand Down
9 changes: 9 additions & 0 deletions frontend/web-app/src/Pages/DisplayPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

function DisplayPage() {
return (
<div>DisplayPage</div>
)
}

export default DisplayPage
9 changes: 9 additions & 0 deletions frontend/web-app/src/Pages/SignUpPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

function SignUpPage() {
return (
<div>SignUpPage</div>
)
}

export default SignUpPage