diff --git a/public/model-s-exterior-front-view.webp b/public/model-s-exterior-front-view.webp new file mode 100644 index 0000000..3af1533 Binary files /dev/null and b/public/model-s-exterior-front-view.webp differ diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 4c3f027..aaa4691 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -8,15 +8,28 @@ import SearchIcon from "@mui/icons-material/Search"; import Divider from "@mui/material/Divider"; import MenuButton from "../MenuButton"; import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown"; -import ColorModeIconDropdown from "../../shared-theme/ColorModeIconDropdown"; import NotificationsRoundedIcon from "@mui/icons-material/NotificationsRounded"; +import SideMenu from "../SideMenu"; +import { useDispatch, useSelector } from "react-redux"; +import { AppDispatch, RootState } from "../../redux/store/store"; +import { fetchAdminProfile } from "../../redux/slices/profileSlice"; +import OptionsMenu from "../OptionsMenu"; export default function Header() { const [showNotifications, setShowNotifications] = React.useState(false); const toggleNotifications = () => { setShowNotifications((prev) => !prev); }; + const [open, setOpen] = React.useState(true); + const dispatch = useDispatch(); + const { user } = useSelector( + (state: RootState) => state?.profileReducer + ); + + React.useEffect(() => { + dispatch(fetchAdminProfile()); + }, [dispatch]); return ( - Momah + {user?.name || "No Admin"} - {/* Dropdown Icon */} - {/* */} diff --git a/src/components/MenuContent/index.tsx b/src/components/MenuContent/index.tsx index 794a33b..e23f179 100644 --- a/src/components/MenuContent/index.tsx +++ b/src/components/MenuContent/index.tsx @@ -47,6 +47,11 @@ export default function MenuContent({ hidden }: PropType) { icon: , url: "/panel/role-list", }, + userRole === "admin" && { + text: "Vehicles", + icon: , + url: "/panel/vehicle-list", + }, ]; const filteredMenuItems = baseMenuItems.filter(Boolean); diff --git a/src/components/OptionsMenu/index.tsx b/src/components/OptionsMenu/index.tsx index 1778e11..8ed491b 100644 --- a/src/components/OptionsMenu/index.tsx +++ b/src/components/OptionsMenu/index.tsx @@ -13,6 +13,7 @@ import MenuButton from "../MenuButton"; import { Avatar } from "@mui/material"; import { useNavigate } from "react-router-dom"; import Logout from "../LogOutFunction/LogOutFunction"; +import { ArrowDropDownIcon } from "@mui/x-date-pickers"; const MenuItem = styled(MuiMenuItem)({ margin: "2px 0", @@ -46,7 +47,7 @@ export default function OptionsMenu({ avatar }: { avatar?: boolean }) { onClick={handleClick} sx={{ borderColor: "transparent" }} > - {avatar ? ( + {/* {avatar ? ( ) : ( - )} + )} */} + Profile - My account + {/* My account Add another account - Settings - + Settings */} + {/* */} - {/* //Eknoor singh and jaanvi - //date:- 13-Feb-2025 - //Implemented logout functionality which was static previously */} - { e.stopPropagation(); setLogoutModal(true); }} + sx={{color:"red"}} > Logout @@ -109,9 +108,9 @@ export default function OptionsMenu({ avatar }: { avatar?: boolean }) { logoutModal={logoutModal} /> - + {/* - + */} diff --git a/src/components/SideMenu/index.tsx b/src/components/SideMenu/index.tsx index 0ff8e9e..357a0b8 100644 --- a/src/components/SideMenu/index.tsx +++ b/src/components/SideMenu/index.tsx @@ -29,10 +29,6 @@ const Drawer = styled(MuiDrawer)({ export default function SideMenu() { const [open, setOpen] = React.useState(true); - //Eknoor singh - //date:- 12-Feb-2025 - //Dispatch is called with user from Authstate Interface - const dispatch = useDispatch(); const { user } = useSelector((state: RootState) => state?.profileReducer); @@ -74,7 +70,7 @@ export default function SideMenu() {