-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathNavMenu.tsx
More file actions
56 lines (53 loc) · 1.37 KB
/
Copy pathNavMenu.tsx
File metadata and controls
56 lines (53 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import NavLink from "@/components/NavLink";
import { Icon } from "@iconify/react";
import {
Box,
Drawer,
List,
ListItem,
ListItemButton,
ListItemIcon,
ListItemText,
Toolbar,
} from "@mui/material";
const MenuOptions = [
{ text: "Play", icon: "streamline:chess-pawn", href: "/play" },
{
text: "Playground",
icon: "mdi:flask-outline",
href: "/playground",
},
{ text: "Analysis", icon: "streamline:magnifying-glass-solid", href: "/" },
{
text: "Database",
icon: "streamline:database",
href: "/database",
},
];
interface Props {
open: boolean;
onClose: () => void;
}
export default function NavMenu({ open, onClose }: Props) {
return (
<Drawer anchor="left" open={open} onClose={onClose}>
<Toolbar />
<Box sx={{ width: 250, overflow: "hidden" }}>
<List>
{MenuOptions.map(({ text, icon, href }) => (
<ListItem key={text} disablePadding sx={{ margin: 0.7 }}>
<NavLink href={href}>
<ListItemButton onClick={onClose}>
<ListItemIcon style={{ paddingLeft: "0.5em" }}>
<Icon icon={icon} height="1.5em" />
</ListItemIcon>
<ListItemText primary={text} />
</ListItemButton>
</NavLink>
</ListItem>
))}
</List>
</Box>
</Drawer>
);
}