Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MenuItem and Menu are not defined #50

Open
saudalham opened this issue Jan 24, 2022 · 2 comments
Open

MenuItem and Menu are not defined #50

saudalham opened this issue Jan 24, 2022 · 2 comments

Comments

@saudalham
Copy link

import React from 'react';

import { AppBar, Toolbar, IconButton, Badge, MenuItem, Menu, Typography } from '@material-ui/core';

import { ShoppingCart } from '@material-ui/icons';

import { Link, useLocation } from 'react-router-dom'

import logo from '../../assets/Star Image.png';

import useStyles from './styles';

const Navbar = ({ totalItems }) => {

const classes = useStyles();

const location = useLocation();


return (

    <>

        <AppBar position="fixed" className={classes.appBar} color="inherit">

            <Toolbar>

                <Typography component={Link} to="/" variant="h6" className={classes.title} color="inherit">

                    <img src={logo} alt="Commerce.js" height="25px" className={classes.image} />

                    Commerce.js

                </Typography>

                <div className={classes.grow} />
                {location.pathname === '/' && (

                <div className={classes.button}>

                    <IconButton component={Link} to="/cart" aria-label="Show Cart Items" color="inherit">

                        <Badge badgeContent={totalItems} color="Secondary">

                            <ShoppingCart />

                        </Badge>

                    </IconButton>

                </div> )

            }</Toolbar>

        </AppBar>

    </>

)

}

export default Navbar

@shvkumar7777
Copy link

import { AppBar,Toolbar,IconButton,Badge,Menu,MenuItem,Typography } from '@mui/material';

i did this, and its working for me

@rjmead23
Copy link

I'm 1:57:45 into the video and as yet even though like you, MenuItem and Menu are imported/declared - their value is never read. I just have warnings in the console. The app works, seems so far these are not added into the UI on the NavBar component. Not sure if we will come back to it later in the class or not. If by the end we don't use them, I'll just remove them from the import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants