Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

Navbar.jsx 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import AppBar from '@mui/material/AppBar';
  2. import Box from '@mui/material/Box';
  3. import Typography from '@mui/material/Typography';
  4. import Image from 'next/image';
  5. const pages = ['Home', 'Menu', 'About', 'Store', 'Contact'];
  6. const Navbar = () => {
  7. // const { data: session } = useSession();
  8. // const [anchorElNav, setAnchorElNav] = useState(null);
  9. // const [anchorElUser, setAnchorElUser] = useState(null);
  10. // const handleOpenNavMenu = (event) => {
  11. // setAnchorElNav(event.currentTarget);
  12. // };
  13. // const handleOpenUserMenu = (event) => {
  14. // setAnchorElUser(event.currentTarget);
  15. // };
  16. // const handleCloseNavMenu = () => {
  17. // setAnchorElNav(null);
  18. // };
  19. // const handleCloseUserMenu = () => {
  20. // setAnchorElUser(null);
  21. // };
  22. // function logoutHandler() {
  23. // signOut();
  24. // }
  25. return (
  26. <AppBar
  27. position="absolute"
  28. sx={{
  29. zIndex: 100,
  30. top: 20,
  31. width: '100%',
  32. backgroundColor: 'transparent',
  33. boxShadow: 'none',
  34. height: 40,
  35. }}
  36. >
  37. <Box sx={{ display: 'flex', width: '100%' }}>
  38. <Box
  39. sx={{
  40. flexGrow: 1,
  41. maxWidth: '50%',
  42. height: 30,
  43. display: { xs: 'none', md: 'flex' },
  44. px: 10,
  45. }}
  46. >
  47. {pages.map((page) => (
  48. <Typography
  49. key={page}
  50. textAlign="center"
  51. sx={{ mx: 'auto', fontSize: 20, fontWeight: 500, color: 'black' }}
  52. >
  53. {page}
  54. </Typography>
  55. ))}
  56. </Box>
  57. <Box
  58. sx={{
  59. flexGrow: 1,
  60. maxWidth: '50%',
  61. height: 30,
  62. display: { xs: 'none', md: 'flex' },
  63. justifyContent: 'right',
  64. pt: 0.5,
  65. mr: 4,
  66. }}
  67. >
  68. <Box
  69. sx={{
  70. mx: 2,
  71. }}
  72. >
  73. <Image
  74. src="/images/profile.svg"
  75. alt="profile"
  76. width={24}
  77. height={24}
  78. />
  79. </Box>
  80. <Box
  81. sx={{
  82. mr: 6,
  83. ml: 2,
  84. }}
  85. >
  86. <Image src="/images/cart.svg" alt="cart" width={24} height={24} />
  87. </Box>
  88. </Box>
  89. </Box>
  90. </AppBar>
  91. );
  92. };
  93. export default Navbar;