-
Notifications
You must be signed in to change notification settings - Fork 0
/
NavBar-Header-DropDown.js
74 lines (56 loc) · 2.85 KB
/
NavBar-Header-DropDown.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
import React, { useState } from 'react'
import { Link } from 'react-router-dom'
function navbar() {
const [dropdown, setDropdown] = useState(false)
return (
<div>
<nav className="navbar navbar-expand-lg navbar-dark bg-dark ">
<a className="navbar-brand mx-5 " href="#">Tech Manifester</a>
<button onClick={() => setDropdown(!dropdown)} className="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span className="navbar-toggler-icon"></span>
</button>
<div className="dropdown1" >
{
dropdown && <ul className="ul">
<li className="li">
<Link to="/" className="nav-link1">Courses <span className="sr-only"></span></Link>
</li>
<li className="li">
<Link to="/pricing" className="nav-link1"> Pricing </Link>
</li>
<li className="li">
<Link className="nav-link1" to='/about' >About</Link>
</li>
<li className="li">
{
localStorage.getItem('access-token') ? (<Link to="/logout" className="nav-link1" href="#">logout</Link>) :
(<Link to="/login" className="nav-link1" href="#">Login</Link>)
}
</li>
</ul>
}
</div>
<div className="collapse navbar-collapse justify-content-center" id="navbarNav">
<ul className="navbar-nav">
<li className="nav-item ">
<Link to="/" className="nav-link">Courses <span className="sr-only"></span></Link>
</li>
<li className="nav-item">
<Link to="/pricing" className="nav-link"> Pricing </Link>
</li>
<li className="nav-item">
<Link className="nav-link" to='/about' >About</Link>
</li>
<li className="nav-item">
{
localStorage.getItem('access-token') ? (<Link to="/logout" className="nav-link" href="#">logout</Link>) :
(<Link to="/login" className="nav-link" href="#">Login</Link>)
}
</li>
</ul>
</div>
</nav>
</div>
)
}
export default navbar