Skip to content

Commit

Permalink
change link of property on renter side navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
YaoLiu010802 committed Sep 27, 2024
1 parent 14e666f commit 7db3ac8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function App() {
<Route path='/Rprofile/:rID' element={<ManagerRoute Component={RprofileForPM}/>} />
<Route path='/PMprofile/:pmID' element={<ManagerRoute Component={PMprofileForPM}/>} />
<Route path='/PM/:pmID' element={<RenterRoute Component={PMprofileForR}/>} />
<Route path='/saved_properties' element={<RenterRoute Component={SavedProperties}/>} />
</Routes>
</ThemeProvider>
)
Expand Down
24 changes: 17 additions & 7 deletions frontend/src/renter-components/navigation_menu/SideDrawer.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import * as React from "react";
import { BrowserRouter as Router, Route, Routes, Link, NavLink } from "react-router-dom";
import {
BrowserRouter as Router,
Route,
Routes,
Link,
NavLink,
} from "react-router-dom";
import Box from "@mui/material/Box";
import Drawer from "@mui/material/Drawer";
import Toolbar from "@mui/material/Toolbar";
Expand All @@ -24,7 +30,7 @@ import { useTheme } from "@mui/material";
const drawerWidth = 200;

export default function SideDrawer() {
const theme = useTheme()
const theme = useTheme();
return (
<Drawer
variant="permanent"
Expand All @@ -48,7 +54,11 @@ export default function SideDrawer() {
icon: <PermContactCalendarIcon />,
link: "/RentalProfile",
},
{ text: "Properties", icon: <PropertiesIcon />, link: "/property" },
{
text: "Properties",
icon: <PropertiesIcon />,
link: "/saved_properties",
},
{
text: "Inspections Apply",
icon: <InspectionIcon />,
Expand All @@ -71,13 +81,13 @@ export default function SideDrawer() {
>
<ListItemIcon>{item.icon}</ListItemIcon>
{/* <ListItemText primary={item.text} /> */}
<NavLink
<NavLink
to={item.link}
style={({ isActive }) => ({
color: isActive ? theme.primary : '#000000',
color: isActive ? theme.primary : "#000000",
fontWeight: isActive ? 700 : 400,
textDecoration: 'none',
padding: 2
textDecoration: "none",
padding: 2,
})}
>
{item.text}
Expand Down

0 comments on commit 7db3ac8

Please sign in to comment.