-
Notifications
You must be signed in to change notification settings - Fork 7
/
HambugerMenu.js
155 lines (142 loc) · 4.57 KB
/
HambugerMenu.js
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import { Grid, MenuItem, Typography, MenuList, Modal } from "@material-ui/core";
import { makeStyles } from "@material-ui/core/styles";
import PropTypes from "prop-types";
import React from "react";
import { URLS } from "@/sensorsafrica/components/DocumentHead/PageHeads";
import MenuButton from "@/sensorsafrica/components/Hambuger/MenuButton";
import Link from "@/sensorsafrica/components/Link";
const useStyles = makeStyles((theme) => ({
grid: {
flex: 1,
},
menuList: {
color: "white",
marginTop: "5rem !important", // Override the default marginTop:'2rem' of <MenuList /> Component
textAlign: "right",
[theme.breakpoints.up("sm")]: {
marginTop: "2rem",
paddingRight: "10%",
},
},
menuListItem: {
color: "white",
display: "block",
},
modalContent: {
margin: "auto",
padding: "20px",
height: "auto",
},
typography: {
color: "#fff",
textAlign: "right",
fontWeight: "700",
},
link: {
textDecoration: "none",
"&:hover": {
textDecoration: "none",
},
},
}));
function HambugerMenu({ handleToggle, menuOpen, ...props }) {
const classes = useStyles(props);
return (
<Grid container className={classes.grid}>
<Grid item xs={12}>
<MenuButton
open={menuOpen}
onClick={handleToggle}
onClose={handleToggle}
/>
</Grid>
<Grid item xs={12}>
<Modal
BackdropProps={{
style: {
backgroundColor: "rgba(0,0,0,0.8)",
},
}}
className={classes.modalContent}
open={menuOpen}
onClose={handleToggle}
disableAutoFocus
>
<MenuList className={classes.menuList}>
<Link href={URLS.AIR.ABOUT} className={classes.link}>
<MenuItem className={classes.menuListItem}>
<Typography className={classes.typography} variant="subtitle1">
ABOUT
</Typography>
</MenuItem>
</Link>
<Link href={URLS.AIR.JOIN} className={classes.link}>
<MenuItem className={classes.menuListItem}>
<Typography className={classes.typography} variant="subtitle1">
CONTACT
</Typography>
</MenuItem>
</Link>
<Link href={URLS.AIR.DATA} className={classes.link}>
<MenuItem className={classes.menuListItem}>
<Typography className={classes.typography} variant="subtitle1">
DATA
</Typography>
</MenuItem>
</Link>
<Link href={URLS.AIR.HOW_SENSORS_WORK} className={classes.link}>
<MenuItem className={classes.menuListItem}>
<Typography className={classes.typography} variant="subtitle1">
HARDWARE
</Typography>
</MenuItem>
</Link>
<Link href={URLS.AIR.JOIN} className={classes.link}>
<MenuItem className={classes.menuListItem}>
<Typography className={classes.typography} variant="subtitle1">
JOIN
</Typography>
</MenuItem>
</Link>
<Link
href={URLS.AIR.MONTHLY_REPORT}
className={classes.link}
target="__blank"
rel="noopener noreferrer"
>
<MenuItem className={classes.menuListItem}>
<Typography className={classes.typography} variant="subtitle1">
MONTHLY AIR REPORTS
</Typography>
</MenuItem>
</Link>
<Link href={URLS.AIR.IMPACT} className={classes.link}>
<MenuItem className={classes.menuListItem}>
<Typography className={classes.typography} variant="subtitle1">
RESOURCES
</Typography>
</MenuItem>
</Link>
<a
href="https://medium.com/@sensors.AFRICA"
className={classes.link}
target="_blank"
rel="noopener noreferrer"
>
<MenuItem className={classes.menuListItem}>
<Typography className={classes.typography} variant="subtitle1">
STORIES
</Typography>
</MenuItem>
</a>
</MenuList>
</Modal>
</Grid>
</Grid>
);
}
HambugerMenu.propTypes = {
handleToggle: PropTypes.func.isRequired,
menuOpen: PropTypes.bool.isRequired,
};
export default HambugerMenu;