diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index cdd83ff..ccff9c4 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx @@ -1,3 +1,4 @@ +import { useState } from "react"; import { useTranslation } from "react-i18next"; import { Button, Typography } from "@mui/joy"; import InventoryIcon from "@mui/icons-material/Inventory"; @@ -6,6 +7,8 @@ import StorageIcon from "@mui/icons-material/Storage"; import SettingsIcon from "@mui/icons-material/Settings"; import ExitToAppIcon from "@mui/icons-material/ExitToApp"; import TranslateIcon from "@mui/icons-material/Translate"; +import MenuIcon from "@mui/icons-material/Menu"; +import CloseIcon from "@mui/icons-material/Close"; import { useNavigate, useMatchRoute } from "@tanstack/react-router"; import Cookies from "js-cookie"; import { changeTranslation } from "../utils/uxFncs"; @@ -14,6 +17,7 @@ export const Sidebar = () => { const { t } = useTranslation(); const navigate = useNavigate(); const matchRoute = useMatchRoute(); + const [isOpen, setIsOpen] = useState(false); const btnClass = "h-11 w-full justify-start! rounded-2xl px-4 text-left text-sm font-semibold text-slate-700 transition hover:bg-white/80 hover:text-[#0b6bcb] [&_.MuiButton-startDecorator]:mr-3! [&_.MuiButton-startDecorator]:ml-0!"; @@ -21,86 +25,120 @@ export const Sidebar = () => { const variant = (to: string) => !!matchRoute({ to, fuzzy: false }) ? "soft" : "plain"; + const handleNavigate = (to: string) => { + navigate({ to }); + setIsOpen(false); + }; + return ( -