I have a react app using material ui, created drawer in it and there is a problem with its background color(color is not displayed), and burger menu toogle(when drawer is opened, burger menu button is lost), after I do npm run build
and then start it with serve -s build
here are my deps:
"@emotion/react": "^11.4.1",
"@fortawesome/fontawesome-free": "^5.15.4",
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.2.0",
"react-redux": "^7.2.5",
"react-router": "^6.0.0-beta.8",
"react-router-dom": "^6.0.0-beta.8",
"react-scripts": "4.0.3",
"web-vitals": "^1.1.2"
drawer code:
const isMobile=useMediaQuery(theme.breakpoints.down(885))
const classes = useStyles();
const drawerContentClass = isMobile===true?
classes.content:clsx(classes.content, { [classes.contentShift]: open})
<div className={classes.root}>
<CssBaseline />
<AppBar
position="fixed"
className={clsx(classes.appBar, {
[classes.appBarShift]: open,
})}
>
<Toolbar style={{background:'#00314D'}}>
<IconButton
color="inherit"
aria-label="open drawer"
onClick={()=>clickFn(!open)}
edge="start"
>
<MenuIcon />
</IconButton>
</Toolbar>
</AppBar>
<Drawer
className={classes.drawer}
variant="persistent"
transitionDuration={{
enter: theme.transitions.duration.leavingScreen,
exit: theme.transitions.duration.leavingScreen
}}
classes={{
paper: classes.drawerPaper
}}
PaperProps={{ elevation: 9 }}
anchor="left"
open={open}
onClose={closeDrawer}
>
//drawer content
</Drawer>
<main className={drawerContentClass} style={{backgroundColor:'rgb(0, 49, 77)'}}> //tried to hardcode here, but this not helped
<div className={classes.drawerHeader} />
</main>
</div>