FPSMS-frontend
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

50 line
1.2 KiB

  1. "use client";
  2. import IconButton from "@mui/material/IconButton";
  3. import MenuIcon from "@mui/icons-material/Menu";
  4. import NavigationContent from "../NavigationContent";
  5. import React from "react";
  6. import Drawer from "@mui/material/Drawer";
  7. const NavigationToggle: React.FC = () => {
  8. const [isOpened, setIsOpened] = React.useState(false);
  9. const openNavigation = () => {
  10. setIsOpened(true);
  11. };
  12. const closeNavigation = () => {
  13. setIsOpened(false);
  14. };
  15. return (
  16. <>
  17. <Drawer variant="permanent" sx={{ display: { xs: "none", xl: "block" } }}>
  18. <NavigationContent />
  19. </Drawer>
  20. <Drawer
  21. sx={{ display: { xl: "none" } }}
  22. open={isOpened}
  23. onClose={closeNavigation}
  24. ModalProps={{
  25. keepMounted: true,
  26. }}
  27. >
  28. <NavigationContent />
  29. </Drawer>
  30. <IconButton
  31. sx={{
  32. display: { xl: "none" },
  33. "&:hover": { backgroundColor: "rgba(0,0,0,0.04)" },
  34. }}
  35. onClick={openNavigation}
  36. edge="start"
  37. aria-label="menu"
  38. color="inherit"
  39. >
  40. <MenuIcon />
  41. </IconButton>
  42. </>
  43. );
  44. };
  45. export default NavigationToggle;