-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSideNavigation.js
78 lines (72 loc) · 2.93 KB
/
SideNavigation.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
import React, {Component} from "react";
import {Link} from "react-router-dom";
// import cctv from "../../static/images/cctv-icon.png";
// import menu from "../../static/images/Menu.png";
// import setting from "../../static/images/settings.png";
// import user from "../../static/images/user.png";
import "./SideNavigation.css";
class SideNavigation extends Component {
constructor() {
super()
this.state = { isOpen: false };
}
toggleOpen = () =>
this.setState(
{ isOpen: true },
document.addEventListener("click", this.handleCloseOutside)
);
handleCloseOutside = () => {
this.setState(
{ isOpen: false },
document.removeEventListener("click", this.handleCloseOutside)
);
};
render() {
const dropdownMenuShow = `dropdown-menu custom-dropdown-menu${this.state.isOpen ? " show" : ""}`;
return (
<div>
<nav id="sidebar">
<div className="sidebar-header">
// <img src={menu} alt=""/>
</div>
<ul className="list-unstyled sidebar-ul">
<li className=" dropdown dropright">
<div onClick={this.toggleOpen} role="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
// <img src={cctv} alt=""/>
</div>
<div className={dropdownMenuShow}
aria-labelledby="navbarDropdown">
<div className="dropdown-item dropdown-item-title disable-title"
>
All Cameras
<span className="badge badge-pill badge-secondary m-2">
8
</span>
</div>
<Link to="" className="dropdown-item">
Show All Cameras
</Link>
<Link to="" className="dropdown-item">
Add New Camera
</Link>
<Link to="" className="dropdown-item">
Add Image
</Link>
</div>
</li>
// <li>
// <img src={setting} alt=""/>
// </li>
// <li>
// <img src={user} alt=""/>
// </li>
</ul>
</nav>
</div>
);
}
}
export default SideNavigation;