-
Notifications
You must be signed in to change notification settings - Fork 844
Expand file tree
/
Copy pathHeader.js
More file actions
36 lines (29 loc) · 798 Bytes
/
Header.js
File metadata and controls
36 lines (29 loc) · 798 Bytes
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
import React from 'react';
function Header(openMenu,userInfo) {
<header className="header">
<div className="brand">
<button onClick={openMenu}>☰</button>
<Link to="/">amazona</Link>
</div>
<div className="header-links">
<a href="cart.html">Cart</a>
{userInfo ? (
<Link to="/profile">{userInfo.name}</Link>
) : (
<Link to="/signin">Sign In</Link>
)}
{userInfo && userInfo.isAdmin && (
<div className="dropdown">
<a href="#">Admin</a>
<ul className="dropdown-content">
<li>
<Link to="/orders">Orders</Link>
<Link to="/products">Products</Link>
</li>
</ul>
</div>
)}
</div>
</header>
}
export default App;