| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- import AppBar from '@mui/material/AppBar';
- import Box from '@mui/material/Box';
- import Typography from '@mui/material/Typography';
- import Image from 'next/image';
- import Link from 'next/link';
- import { useRouter } from 'next/router';
- import {
- BASE_PAGE,
- CART_PAGE,
- PRODUCTS_PAGE,
- PROFILE_PAGE,
- } from '../../../constants/pages';
-
- const Navbar = () => {
- const router = useRouter();
-
- return (
- <AppBar
- position="absolute"
- sx={{
- zIndex: 100,
- top: 20,
- width: '100%',
- backgroundColor: 'transparent',
- boxShadow: 'none',
- height: 40,
- }}
- >
- <Box sx={{ display: 'flex', width: '100%' }}>
- <Box
- sx={{
- flexGrow: 1,
- maxWidth: '50%',
- height: 30,
- display: { xs: 'none', md: 'flex' },
- px: 10,
- }}
- >
- <Link key="home" href={BASE_PAGE}>
- <Typography
- textAlign="center"
- sx={{
- mx: 'auto',
- fontSize: 20,
- fontWeight: 500,
- color: router.pathname === '/' ? 'white' : 'black',
- textDecoration: 'none',
- cursor: 'pointer',
- }}
- >
- Home
- </Typography>
- </Link>
-
- <Link key="menu" href={BASE_PAGE}>
- <Typography
- textAlign="center"
- sx={{
- mx: 'auto',
- fontSize: 20,
- fontWeight: 500,
- color: router.pathname === '/' ? 'white' : 'black',
- textDecoration: 'none',
- cursor: 'pointer',
- }}
- >
- Menu
- </Typography>
- </Link>
-
- <Link key="about" href={BASE_PAGE}>
- <Typography
- textAlign="center"
- sx={{
- mx: 'auto',
- fontSize: 20,
- fontWeight: 500,
- color: router.pathname === '/' ? 'white' : 'black',
- textDecoration: 'none',
- cursor: 'pointer',
- }}
- >
- About
- </Typography>
- </Link>
-
- <Link key="store" href={PRODUCTS_PAGE}>
- <Typography
- textAlign="center"
- sx={{
- mx: 'auto',
- fontSize: 20,
- fontWeight: 500,
- color: router.pathname === '/' ? 'white' : 'black',
- textDecoration: 'none',
- cursor: 'pointer',
- }}
- >
- Store
- </Typography>
- </Link>
-
- <Link key="contact" href={BASE_PAGE}>
- <Typography
- textAlign="center"
- sx={{
- mx: 'auto',
- fontSize: 20,
- fontWeight: 500,
- color: router.pathname === '/' ? 'white' : 'black',
- textDecoration: 'none',
- cursor: 'pointer',
- }}
- >
- Contact
- </Typography>
- </Link>
- </Box>
- <Box
- sx={{
- flexGrow: 1,
- maxWidth: '50%',
- height: 30,
- display: { xs: 'none', md: 'flex' },
- justifyContent: 'right',
- pt: 0.5,
- mr: 4,
- }}
- >
- <Box
- sx={{
- mx: 2,
- cursor: 'pointer',
- }}
- >
- <Link key="home" href={PROFILE_PAGE}>
- <Image
- src="/images/profile.svg"
- alt="profile"
- width={24}
- height={24}
- />
- </Link>
- </Box>
- <Box
- sx={{
- mr: 6,
- ml: 2,
- cursor: 'pointer',
- }}
- >
- <Link key="home" href={CART_PAGE}>
- <Image src="/images/cart.svg" alt="cart" width={24} height={24} />
- </Link>
- ,
- </Box>
- </Box>
- </Box>
- </AppBar>
- );
- };
-
- export default Navbar;
|