material ui drawer fix

This commit is contained in:
Dan Dobos
2022-05-05 23:51:46 +02:00
parent 559654aa9d
commit e107d0d99e
2 changed files with 10 additions and 4 deletions
@@ -20,7 +20,7 @@ const Footer = () => {
inline='true' inline='true'
variant='body1' variant='body1'
fontFamily='Nanum Gothic Coding'> fontFamily='Nanum Gothic Coding'>
Dan Dobos © {getCurrentYear()} Build with passion Dan Dobos © {getCurrentYear()}
</Typography> </Typography>
</Grid> </Grid>
</Grid> </Grid>
@@ -36,6 +36,12 @@ const Navigation = () => {
setValue(newValue); setValue(newValue);
}; };
const handleDrawerClose = () => {
setTimeout(() => {
setOpenDrawer(false);
}, 100);
};
const routes = useMemo( const routes = useMemo(
() => [ () => [
{ {
@@ -73,14 +79,13 @@ const Navigation = () => {
case `${route.link}`: case `${route.link}`:
if (value !== route.activeIndex) { if (value !== route.activeIndex) {
setValue(route.activeIndex); setValue(route.activeIndex);
setOpenDrawer(false);
} }
break; break;
default: default:
return false; return false;
} }
}); });
}, [value, openDrawer, routes]); }, [value, routes]);
return ( return (
<Container ref={wrapper}> <Container ref={wrapper}>
@@ -138,7 +143,8 @@ const Navigation = () => {
selected={value === route.activeIndex} selected={value === route.activeIndex}
onClick={() => { onClick={() => {
setValue(route.activeIndex); setValue(route.activeIndex);
setOpenDrawer(false);
handleDrawerClose();
}}> }}>
<ListItemText <ListItemText
disableTypography disableTypography