-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathNav.js
More file actions
62 lines (58 loc) Β· 1.58 KB
/
Copy pathNav.js
File metadata and controls
62 lines (58 loc) Β· 1.58 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
57
58
59
60
61
62
import React, { useState } from "react";
import HamburgerMenu from "react-hamburger-menu";
import "./Nav.css";
import { Link } from "react-router-dom";
function Nav(props) {
const [hamburgerOpen, setHamburgerOpen] = useState(false);
function makeLink(k, i) {
return (
<div className="navEl" key={i}>
<Link
to={"/" + k}
onClick={() => {
setHamburgerOpen(false);
}}
className="navEl"
>
{k}
</Link>
</div>
);
}
return (
<>
<div className="burger">
<HamburgerMenu
isOpen={hamburgerOpen}
menuClicked={() => setHamburgerOpen(hamburgerOpen ? false : true)}
width={30}
height={20}
strokeWidth={4}
rotate={0}
animationDuration={0.2}
className="burger"
color="slategray"
/>
</div>
<div id="nav" key="nav" className={"hamburger-" + hamburgerOpen}>
<div id="inner-nav">{[Object.keys(props.textVars).map(makeLink)]}</div>
<div id="footer">
<p>
This is{" "}
<b>
<a href="https://github.com/postlight/account">Account</a>
</b>
, a{" "}
<a href="https://postlight.com/labs">
Postlight Labs project
</a>{" "}
by <a href="https://twitter.com/ftrain">Paul Ford</a>.{" "}
<a href="https://github.com/postlight/account">Get the code</a>,
it's open source.
</p>
</div>
</div>
</>
);
}
export default Nav;