-
Notifications
You must be signed in to change notification settings - Fork 0
/
Nav.js
48 lines (44 loc) · 1.11 KB
/
Nav.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
import React, { useState } from "react";
import logo from "../images/Logo .svg";
const Nav = () => {
const [menuOpen, setMenuOpen] = useState(false);
const toggleMenu = () => {
setMenuOpen(!menuOpen);
};
return (
<nav className={`navbar ${menuOpen ? "open" : ""}`}>
<a href="/" className="logo">
<img src={logo} alt="" />
</a>
<div className="menu-icon" onClick={toggleMenu}>
<div className="bar"></div>
<div className="bar"></div>
<div className="bar"></div>
</div>
<ul className={`nav-links ${menuOpen ? "visible" : ""}`}>
<li>
<a href="/">Home</a>
</li>
<li>
<a href="/">About</a>
</li>
<li>
<a href="/">Services</a>
</li>
<li>
<a href="/">Menu</a>
</li>
<li>
<a href="/">Reservations</a>
</li>
<li>
<a href="/booking">Order Online</a>
</li>
<li>
<a href="/">Login</a>
</li>
</ul>
</nav>
);
};
export default Nav;