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'
variant='body1'
fontFamily='Nanum Gothic Coding'>
Dan Dobos © {getCurrentYear()} Build with passion
Dan Dobos © {getCurrentYear()}
</Typography>
</Grid>
</Grid>
@@ -36,6 +36,12 @@ const Navigation = () => {
setValue(newValue);
};
const handleDrawerClose = () => {
setTimeout(() => {
setOpenDrawer(false);
}, 100);
};
const routes = useMemo(
() => [
{
@@ -73,14 +79,13 @@ const Navigation = () => {
case `${route.link}`:
if (value !== route.activeIndex) {
setValue(route.activeIndex);
setOpenDrawer(false);
}
break;
default:
return false;
}
});
}, [value, openDrawer, routes]);
}, [value, routes]);
return (
<Container ref={wrapper}>
@@ -138,7 +143,8 @@ const Navigation = () => {
selected={value === route.activeIndex}
onClick={() => {
setValue(route.activeIndex);
setOpenDrawer(false);
handleDrawerClose();
}}>
<ListItemText
disableTypography