Create a drawer component #11

This commit is contained in:
Prayag Prajapati committed 2023-07-04 14:03:13 +05:30
1 parent 3f44e5fc96
commit 83ebd5de7e
4 files changed
+619 -390

No files matched your search

+8 -1
View File
@@ -27,6 +27,7 @@ import { MdiArrowLeft } from "../icons/mdiArrowLeft";
import { MdiCog } from "../icons/mdiCog";
import { MdiInformation } from "../icons/mdiInformation";
import { MdiMenu } from "../icons/mdiMenu";
import { useDrawerStore } from "../../utils/store/drawer";
export const AppBar = () => {
const navigate = useNavigate();
@@ -60,6 +61,12 @@ export const AppBar = () => {
setAnchorEl(null);
};
const [setDrawerOpen] = useDrawerStore((state) => [state.setOpen]);
const handleDrawerOpen = () => {
setDrawerOpen(true);
};
useEffect(() => {
if (
location.pathname.includes("login") ||
@@ -110,7 +117,7 @@ export const AppBar = () => {
<IconButton
color="inherit"
aria-label="open drawer"
// onClick={handleDrawerOpen}
onClick={handleDrawerOpen}
>
<MdiMenu />
</IconButton>