-
Notifications
You must be signed in to change notification settings - Fork 622
/
Copy pathFixedPlugin.js
208 lines (203 loc) · 6.64 KB
/
FixedPlugin.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/*eslint-disable*/
import React, { Component } from "react";
// nodejs library to set properties for components
import PropTypes from "prop-types";
// nodejs library that concatenates classes
import classnames from "classnames";
import imagine1 from "assets/img/sidebar-1.jpg";
import imagine2 from "assets/img/sidebar-2.jpg";
import imagine3 from "assets/img/sidebar-3.jpg";
import imagine4 from "assets/img/sidebar-4.jpg";
import Button from "components/CustomButtons/Button.js";
export default function FixedPlugin(props) {
const [classes, setClasses] = React.useState("dropdown show");
const [bg_checked, setBg_checked] = React.useState(true);
const [bgImage, setBgImage] = React.useState(props.bgImage);
const handleClick = () => {
props.handleFixedClick();
};
return (
<div
className={classnames("fixed-plugin", {
"rtl-fixed-plugin": props.rtlActive,
})}
>
<div id="fixedPluginClasses" className={props.fixedClasses}>
<div onClick={handleClick}>
<i className="fa fa-cog fa-2x" />
</div>
<ul className="dropdown-menu">
<li className="header-title">SIDEBAR FILTERS</li>
<li className="adjustments-line">
<a className="switch-trigger">
<div>
<span
className={
props.bgColor === "white"
? "badge filter badge-white active"
: "badge filter badge-white"
}
data-color="white"
onClick={() => {
props.handleColorClick("white");
}}
/>
<span
className={
props.bgColor === "purple"
? "badge filter badge-purple active"
: "badge filter badge-purple"
}
data-color="purple"
onClick={() => {
props.handleColorClick("purple");
}}
/>
<span
className={
props.bgColor === "blue"
? "badge filter badge-blue active"
: "badge filter badge-blue"
}
data-color="blue"
onClick={() => {
props.handleColorClick("blue");
}}
/>
<span
className={
props.bgColor === "green"
? "badge filter badge-green active"
: "badge filter badge-green"
}
data-color="green"
onClick={() => {
props.handleColorClick("green");
}}
/>
<span
className={
props.bgColor === "red"
? "badge filter badge-red active"
: "badge filter badge-red"
}
data-color="red"
onClick={() => {
props.handleColorClick("red");
}}
/>
<span
className={
props.bgColor === "orange"
? "badge filter badge-orange active"
: "badge filter badge-orange"
}
data-color="orange"
onClick={() => {
props.handleColorClick("orange");
}}
/>
</div>
</a>
</li>
<li className="header-title">Images</li>
<li className={bgImage === imagine1 ? "active" : ""}>
<a
className="img-holder switch-trigger"
onClick={() => {
setBgImage(imagine1);
props.handleImageClick(imagine1);
}}
>
<img src={imagine1} alt="..." />
</a>
</li>
<li className={bgImage === imagine2 ? "active" : ""}>
<a
className="img-holder switch-trigger"
onClick={() => {
setBgImage(imagine2);
props.handleImageClick(imagine2);
}}
>
<img src={imagine2} alt="..." />
</a>
</li>
<li className={bgImage === imagine3 ? "active" : ""}>
<a
className="img-holder switch-trigger"
onClick={() => {
setBgImage(imagine3);
props.handleImageClick(imagine3);
}}
>
<img src={imagine3} alt="..." />
</a>
</li>
<li className={bgImage === imagine4 ? "active" : ""}>
<a
className="img-holder switch-trigger"
onClick={() => {
setBgImage(imagine4);
props.handleImageClick(imagine4);
}}
>
<img src={imagine4} alt="..." />
</a>
</li>
<li className="button-container">
<div className="button-container">
<Button
color="success"
href="https://www.creative-tim.com/product/nextjs-material-dashboard?ref=njsmd-fixed-plugin"
target="_blank"
fullWidth
>
Download free!
</Button>
</div>
</li>
<li className="button-container">
<div className="button-container">
<Button
color="warning"
href="https://www.creative-tim.com/product/nextjs-material-dashboard-pro?ref=njsmd-fixed-plugin"
target="_blank"
fullWidth
>
Get PRO version
</Button>
</div>
</li>
<li className="button-container">
<Button
color="info"
fullWidth
href="https://www.creative-tim.com/learning-lab/nextjs/overview/material-dashboard?ref=njsmd-fixed-plugin"
target="_blank"
>
Documentation
</Button>
</li>
<li className="adjustments-line" />
</ul>
</div>
</div>
);
}
FixedPlugin.propTypes = {
bgImage: PropTypes.string,
handleFixedClick: PropTypes.func,
rtlActive: PropTypes.bool,
fixedClasses: PropTypes.string,
bgColor: PropTypes.oneOf([
"white",
"purple",
"blue",
"green",
"orange",
"red",
]),
handleColorClick: PropTypes.func,
handleImageClick: PropTypes.func,
};