Skip to content

Commit

Permalink
fix: Drawer navigation bug complete fix made (#30)
Browse files Browse the repository at this point in the history
* fix: Drawer navigation bug complete fix made

* fix: Drawer navigation bug complete fix made

* fix: modified bug created by previous fix
  • Loading branch information
Uyadav207 authored Mar 11, 2021
1 parent 0c5cc65 commit 830b40b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/containers/Drawer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ function ResponsiveDrawer(props) {
const theme = useTheme();
const [mobileOpen, setMobileOpen] = React.useState(false);

const handleDrawerToggle = () => {
setMobileOpen(!mobileOpen);
const handleDrawerToggle = (value) => {
if(value === false){
setMobileOpen(false);
} else {
setMobileOpen(true);
}
};

const drawer = (
Expand All @@ -83,6 +87,7 @@ function ResponsiveDrawer(props) {
<Link
key={elm.name}
to={elm.path}
onClick={() => handleDrawerToggle(false)}
>
<ListItem button key={elm.name}>
<ListItemText primary={elm.name} />
Expand Down Expand Up @@ -138,7 +143,7 @@ function ResponsiveDrawer(props) {
variant="temporary"
anchor={theme.direction === "rtl" ? "right" : "left"}
open={mobileOpen}
onClose={handleDrawerToggle}
onClose={() => handleDrawerToggle(false)}
classes={{
paper: classes.drawerPaper,
}}
Expand Down

0 comments on commit 830b40b

Please sign in to comment.