l-min-components 1.0.216 → 1.0.223

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.0.216",
3
+ "version": "1.0.223",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { NavContainer, NavButton } from "./style"
3
+ import LeftImage from "./images/leftDateIcon.png";
4
+ import Rightimage from "./images/rightDateIcon.png";
5
+
6
+ const CustomDatePickerHeader = ({ selected, onMonthChange }) => {
7
+ const handlePrevClick = () => {
8
+ onMonthChange(-1);
9
+ };
10
+
11
+ const handleNextClick = () => {
12
+ onMonthChange(1);
13
+ };
14
+
15
+ return (
16
+ <NavContainer className="custom-datepicker-header">
17
+ <div className="custom-datepicker-selected-month">
18
+ {selected.toLocaleString('default', { month: 'long' })} {selected.getFullYear()}
19
+ </div>
20
+ <div className='buttons'>
21
+ <NavButton onClick={handlePrevClick} className='left_icon'>
22
+ {/* <FontAwesomeIcon icon={faChevronLeft} /> */}
23
+ <img src={LeftImage} alt='' className='icon' />
24
+ </NavButton>
25
+ <NavButton onClick={handleNextClick} className='right_icon'>
26
+ {/* <FontAwesomeIcon icon={faChevronRight} /> */}
27
+ <img src={Rightimage} alt='' />
28
+ </NavButton>
29
+ </div>
30
+
31
+
32
+ </NavContainer>
33
+ );
34
+ };
35
+
36
+ export default CustomDatePickerHeader;
@@ -0,0 +1,48 @@
1
+ import React, { useState } from "react";
2
+ import DatePicker from "react-datepicker";
3
+ import { CalendarIcon } from "./svg/calendar";
4
+ import { DownloadIcon } from "./svg/download";
5
+ import CustomDatePickerHeader from "./dateNavigation";
6
+ import { DatePickerWrapper, DateCont } from "./style";
7
+
8
+ const DatePickerCalender = ({
9
+ borderColor,
10
+ ...props
11
+ }) => {
12
+ const [dateRange, setDateRange] = useState({
13
+ startDate: new Date(),
14
+ endDate: new Date(),
15
+ });
16
+
17
+ return(
18
+ <DatePickerWrapper {...props}>
19
+ <DateCont className="datepicker__wrapper" borderColor={borderColor}>
20
+ <DatePicker
21
+ selected={dateRange.endDate}
22
+ endDate={dateRange.endDate}
23
+ dateFormat="d MMM yyyy"
24
+ renderCustomHeader={({ date, decreaseMonth, increaseMonth }) => (
25
+ <CustomDatePickerHeader selected={date} onMonthChange={(value) => {
26
+ if (value === -1) {
27
+ decreaseMonth();
28
+ } else if (value === 1) {
29
+ increaseMonth();
30
+ }
31
+ }} />
32
+ )}
33
+ onChange={(dates) =>
34
+ setDateRange({
35
+ ...dateRange,
36
+ endDate: dates,
37
+ })
38
+ }
39
+ calendarClassName="datepicker_style"
40
+ />
41
+ <CalendarIcon />
42
+ </DateCont>
43
+ </DatePickerWrapper>
44
+
45
+ )
46
+ }
47
+
48
+ export default DatePickerCalender
@@ -0,0 +1,221 @@
1
+ import styled from "styled-components";
2
+
3
+ export const DatePickerWrapper = styled.div`
4
+ `;
5
+
6
+ export const DateCont = styled.div`
7
+ display: flex;
8
+ align-items: center;
9
+ width: 120px;
10
+ border-radius: 10px;
11
+ padding: 7px 12px;
12
+ // border: 0.5px solid #e0e0e0;
13
+ border: 0.5px solid ${(props) => (props.borderColor ? props.borderColor : "#e0e0e0")};
14
+
15
+
16
+ .react-datepicker{
17
+ background: #FFFFFF;
18
+ border: none;
19
+ border-radius: 12px;
20
+ z-index: 1;
21
+ // padding: 5px;
22
+
23
+ }
24
+
25
+ .react-datepicker__header{
26
+ background: #FFFFFF;
27
+ border: none;
28
+
29
+ }
30
+ .react-datepicker__current-month{
31
+ display: flex;
32
+ justify-content: space-between;
33
+ padding: 5px 20px;
34
+ padding-top: 20px;
35
+ padding-bottom: 20px;
36
+ font-weight: 600;
37
+ font-size: 16px;
38
+ }
39
+
40
+ .react-datepicker__navigation {
41
+ background: #F7F7F7;
42
+ border: 0.458333px solid #E0E0E0;
43
+ border-radius: 1.83333px;
44
+ padding: 15px;
45
+ margin-top: 15px;
46
+ // margin-right: 10px;
47
+
48
+ }
49
+ .react-datepicker__navigation--next {
50
+ margin-right: 22px;
51
+ font-size: 10px;
52
+ }
53
+
54
+ .react-datepicker__day--keyboard-selected{
55
+ background: #00C2C2;
56
+ }
57
+
58
+ .react-datepicker__navigation--previous {
59
+ margin-left: 275px;
60
+ font-size: 10px;
61
+ }
62
+
63
+ .react-datepicker__navigation-icon--next {
64
+ width: 10px;
65
+ height: 20px;
66
+ font-size: 20px;
67
+ margin-right: 10px;
68
+ }
69
+
70
+ .react-datepicker__navigation-icon--previous{
71
+ width: 10px;
72
+ height: 20px;
73
+ font-size: 20px;
74
+ margin-left: 10px;
75
+ }
76
+
77
+ .react-datepicker__navigation-icon--next{
78
+
79
+ }
80
+
81
+ .react-datepicker__day-names {
82
+ display: flex;
83
+ justify-content: space-around;
84
+ font-weight: 600;
85
+ font-size: 15px;
86
+ padding: 5px 5px;
87
+
88
+ }
89
+
90
+ .datepicker_style{
91
+ background: #FFFFFF;
92
+ border-radius: 12px;
93
+ .react-datepicker__day{
94
+ width: 46px;
95
+ height: 33px;
96
+ padding: 4px;
97
+ font-size: 14px;
98
+ &:focus {
99
+ border: 2px solid rgba(59, 59, 59, 0.282);
100
+ }
101
+ color: #444444;
102
+ &:hover {
103
+ color: #0094BA;
104
+ background: rgba(0, 148, 186, 0.04);
105
+ }
106
+ }
107
+
108
+ .react-datepicker__day--selected{
109
+ background: #00C2C2;
110
+ color: #EEEEEE;
111
+ border-radius: 10px;
112
+
113
+ &:hover {
114
+ color: #0094BA;
115
+ background: rgba(0, 148, 186, 0.04);
116
+ }
117
+ }
118
+ }
119
+
120
+ svg {
121
+ width: 45px;
122
+ }
123
+ .react-datepicker-wrapper {
124
+ width: auto !important;
125
+
126
+ .react-datepicker__input-container input {
127
+ border: none;
128
+ font-size: 12px;
129
+ width: 100%;
130
+ outline: none;
131
+ }
132
+ }
133
+
134
+ .react-datepicker__day--selected,
135
+ .react-datepicker__day--keyboard-selected,
136
+ .react-datepicker__day--in-selecting-range,
137
+ .react-datepicker__day--in-range {
138
+ border-radius: 1.3rem;
139
+ background-color: rgba(176, 220, 220, 0.42);
140
+ color: #313333;
141
+ }
142
+ .datepicker-container {
143
+ display: flex;
144
+ align-items: center;
145
+ position: relative;
146
+ color: rgba(176, 220, 220, 0.42);
147
+ // width: 215px;
148
+ padding: 8px 16px;
149
+ border-radius: 12px;
150
+ font-size: 13px;
151
+ margin-left: auto;
152
+ }
153
+ `;
154
+
155
+ export const GraphCardBody = styled.div`
156
+ width: 100%;
157
+ display: flex;
158
+ margin-top: 20px;
159
+ margin-bottom: 10px;
160
+ `;
161
+
162
+ export const GraphCardFooter = styled.div`
163
+ width: 100%;
164
+ display: flex;
165
+
166
+ span {
167
+ background-color: #f3f3f3;
168
+ border: 0.5px solid #d9d9d9;
169
+ font-weight: 500;
170
+ font-size: 12px;
171
+ color: #000000;
172
+ border-radius: 10px;
173
+ margin-right: 10px;
174
+ padding: 12px 16px;
175
+ cursor: pointer;
176
+
177
+ &.active {
178
+ background-color: #00c2c2;
179
+ color: #ffffff;
180
+ }
181
+ }
182
+ `;
183
+
184
+
185
+ // Date picker Navigation button
186
+
187
+ export const NavContainer = styled.div`
188
+ display: flex;
189
+ justify-content: space-between;
190
+ margin-right: 20px;
191
+ padding: 3px;
192
+
193
+ .custom-datepicker-selected-month{
194
+ font-weight: 600;
195
+ font-size: 16px;
196
+ line-height: 150%;
197
+ text-align: center;
198
+ color: #000000;
199
+ margin-left: 20px;
200
+ }
201
+
202
+ .buttons{
203
+ display: flex;
204
+ }
205
+
206
+ .left_icon{
207
+ margin-right: 7px;
208
+ }
209
+ `;
210
+
211
+ export const NavButton = styled.div`
212
+ display: flex;
213
+ justify-content: center;
214
+ align-items: center;
215
+ background: #F7F7F7;
216
+ width: 22px;
217
+ height: 22px;
218
+
219
+
220
+
221
+ `;
@@ -0,0 +1,64 @@
1
+ import React from "react";
2
+ export const CalendarIcon = ({ width, height, fill, onClick }) => (
3
+ <svg
4
+ onClick={onClick}
5
+ width={width || "18"}
6
+ height={height || "18"}
7
+ viewBox="0 0 18 18"
8
+ fill="none"
9
+ xmlns="http://www.w3.org/2000/svg">
10
+ <path
11
+ d="M6 1.5V3.75"
12
+ stroke="#616161"
13
+ strokeWidth="1.5"
14
+ strokeMiterlimit="10"
15
+ strokeLinecap="round"
16
+ strokeLinejoin="round"
17
+ />
18
+ <path
19
+ d="M12 1.5V3.75"
20
+ stroke="#616161"
21
+ strokeWidth="1.5"
22
+ strokeMiterlimit="10"
23
+ strokeLinecap="round"
24
+ strokeLinejoin="round"
25
+ />
26
+ <path
27
+ d="M2.625 6.81641H15.375"
28
+ stroke="#616161"
29
+ strokeWidth="1.5"
30
+ strokeMiterlimit="10"
31
+ strokeLinecap="round"
32
+ strokeLinejoin="round"
33
+ />
34
+ <path
35
+ d="M15.75 6.375V12.75C15.75 15 14.625 16.5 12 16.5H6C3.375 16.5 2.25 15 2.25 12.75V6.375C2.25 4.125 3.375 2.625 6 2.625H12C14.625 2.625 15.75 4.125 15.75 6.375Z"
36
+ stroke="#616161"
37
+ strokeWidth="1.5"
38
+ strokeMiterlimit="10"
39
+ strokeLinecap="round"
40
+ strokeLinejoin="round"
41
+ />
42
+ <path
43
+ d="M8.99588 10.2734H9.00262"
44
+ stroke="#616161"
45
+ strokeWidth="1.5"
46
+ strokeLinecap="round"
47
+ strokeLinejoin="round"
48
+ />
49
+ <path
50
+ d="M6.22244 10.2734H6.22918"
51
+ stroke="#616161"
52
+ strokeWidth="1.5"
53
+ strokeLinecap="round"
54
+ strokeLinejoin="round"
55
+ />
56
+ <path
57
+ d="M6.22244 12.5234H6.22918"
58
+ stroke="#616161"
59
+ strokeWidth="1.5"
60
+ strokeLinecap="round"
61
+ strokeLinejoin="round"
62
+ />
63
+ </svg>
64
+ );
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ export const DownloadIcon = ({ width, height, fill, onClick }) => (
3
+ <svg
4
+ onClick={onClick}
5
+ width={width || "18"}
6
+ height={height || "19"}
7
+ viewBox="0 0 18 19"
8
+ fill="none"
9
+ xmlns="http://www.w3.org/2000/svg">
10
+ <path
11
+ d="M12.6969 7.41797C15.6969 7.6763 16.9219 9.21797 16.9219 12.593L16.9219 12.7013C16.9219 16.4263 15.4302 17.918 11.7052 17.918L6.27187 17.918C2.54688 17.918 1.05521 16.4263 1.05521 12.7013L1.05521 12.593C1.05521 9.24297 2.26354 7.7013 5.21354 7.4263"
12
+ stroke="#52565F"
13
+ strokeWidth="1.5"
14
+ strokeLinecap="round"
15
+ strokeLinejoin="round"
16
+ />
17
+ <path
18
+ d="M9 1.66797L9 12.4013"
19
+ stroke="#52565F"
20
+ strokeWidth="1.5"
21
+ strokeLinecap="round"
22
+ strokeLinejoin="round"
23
+ />
24
+ <path
25
+ d="M11.7891 10.543L8.9974 13.3346L6.20573 10.543"
26
+ stroke="#52565F"
27
+ strokeWidth="1.5"
28
+ strokeLinecap="round"
29
+ strokeLinejoin="round"
30
+ />
31
+ </svg>
32
+ );
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { NavContainer, NavButton } from "./index.styled"
3
+ import LeftImage from "./images/leftDateIcon.png";
4
+ import Rightimage from "./images/rightDateIcon.png";
5
+
6
+
7
+ const CustomDatePickerHeader = ({ selected, onMonthChange }) => {
8
+ const handlePrevClick = () => {
9
+ onMonthChange(-1);
10
+ };
11
+
12
+ const handleNextClick = () => {
13
+ onMonthChange(1);
14
+ };
15
+
16
+ return (
17
+ <NavContainer className="custom-datepicker-header">
18
+ <div className="custom-datepicker-selected-month">
19
+ {selected.toLocaleString('default', { month: 'long' })} {selected.getFullYear()}
20
+ </div>
21
+ <div className='buttons'>
22
+ <NavButton onClick={handlePrevClick} className='left_icon'>
23
+ {/* <FontAwesomeIcon icon={faChevronLeft} /> */}
24
+ <img src={LeftImage} alt='' className='icon' />
25
+ </NavButton>
26
+ <NavButton onClick={handleNextClick} className='right_icon'>
27
+ {/* <FontAwesomeIcon icon={faChevronRight} /> */}
28
+ <img src={Rightimage} alt='' />
29
+ </NavButton>
30
+ </div>
31
+
32
+
33
+ </NavContainer>
34
+ );
35
+ };
36
+
37
+ export default CustomDatePickerHeader;
@@ -11,6 +11,7 @@ import moment from "moment";
11
11
  import { CalendarIcon } from "../../assets/svg/calendar";
12
12
  import { DownloadIcon } from "../../assets/svg/download";
13
13
  import GraphChart from "./graphData";
14
+ import CustomDatePickerHeader from "./dateNavigation"
14
15
 
15
16
  /**
16
17
  * @param {{
@@ -45,6 +46,15 @@ const GraphComponent = (props) => {
45
46
  selected={dateRange.startDate}
46
47
  startDate={dateRange.startDate}
47
48
  dateFormat="d MMM yyyy"
49
+ renderCustomHeader={({ date, decreaseMonth, increaseMonth }) => (
50
+ <CustomDatePickerHeader selected={date} onMonthChange={(value) => {
51
+ if (value === -1) {
52
+ decreaseMonth();
53
+ } else if (value === 1) {
54
+ increaseMonth();
55
+ }
56
+ }} />
57
+ )}
48
58
  onChange={(dates) =>
49
59
  setDateRange({
50
60
  ...dateRange,
@@ -61,6 +71,15 @@ const GraphComponent = (props) => {
61
71
  selected={dateRange.endDate}
62
72
  endDate={dateRange.endDate}
63
73
  dateFormat="d MMM yyyy"
74
+ renderCustomHeader={({ date, decreaseMonth, increaseMonth }) => (
75
+ <CustomDatePickerHeader selected={date} onMonthChange={(value) => {
76
+ if (value === -1) {
77
+ decreaseMonth();
78
+ } else if (value === 1) {
79
+ increaseMonth();
80
+ }
81
+ }} />
82
+ )}
64
83
  onChange={(dates) =>
65
84
  setDateRange({
66
85
  ...dateRange,
@@ -259,3 +259,42 @@ export const GraphCardFooter = styled.div`
259
259
  }
260
260
  }
261
261
  `;
262
+
263
+
264
+ // Date picker Navigation button
265
+
266
+ export const NavContainer = styled.div`
267
+ display: flex;
268
+ justify-content: space-between;
269
+ margin-right: 20px;
270
+ padding: 3px;
271
+
272
+ .custom-datepicker-selected-month{
273
+ font-weight: 600;
274
+ font-size: 16px;
275
+ line-height: 150%;
276
+ text-align: center;
277
+ color: #000000;
278
+ margin-left: 20px;
279
+ }
280
+
281
+ .buttons{
282
+ display: flex;
283
+ }
284
+
285
+ .left_icon{
286
+ margin-right: 7px;
287
+ }
288
+ `;
289
+
290
+ export const NavButton = styled.div`
291
+ display: flex;
292
+ justify-content: center;
293
+ align-items: center;
294
+ background: #F7F7F7;
295
+ width: 22px;
296
+ height: 22px;
297
+
298
+
299
+
300
+ `;
@@ -22,7 +22,7 @@ const AccountDropdown = (props) => {
22
22
  const [developerAccountData, setDeveloperAccountData] = useState([]);
23
23
  const [instructorAccountData, setInstructorAccountData] = useState([]);
24
24
  const [enterpriseAccountData, setEnterpriseAccountData] = useState([]);
25
- const [selectedAccount, setSelectedAccount] = useState();
25
+ // const [selectedAccount, setSelectedAccount] = useState();
26
26
  const navigate = useNavigate();
27
27
  const { pathname } = useLocation();
28
28
  useEffect(() => {}, [pathname]);
@@ -64,52 +64,52 @@ const AccountDropdown = (props) => {
64
64
  });
65
65
 
66
66
  if (pathname?.includes("personal")) {
67
- setSelectedAccount(personalArray[0]);
67
+ props?.setSelectedAccount(personalArray[0]);
68
68
  }
69
69
  if (window.location.host?.includes("developer")) {
70
- setSelectedAccount(developerArray[0]);
70
+ props?.setSelectedAccount(developerArray[0]);
71
71
  }
72
72
  if (pathname?.includes("instructor")) {
73
- setSelectedAccount(instructorArray[0]);
73
+ props?.setSelectedAccount(instructorArray[0]);
74
74
  }
75
75
  if (pathname?.includes("enterprise")) {
76
- setSelectedAccount(enterpriseArray[0]);
76
+ props?.setSelectedAccount(enterpriseArray[0]);
77
77
  }
78
78
  }
79
79
  }, [props?.data?.data]);
80
80
  useEffect(() => {
81
- if (selectedAccount?.type === "DEVELOPER") {
81
+ if (props?.selectedAccount?.type === "DEVELOPER") {
82
82
  const date = new Date();
83
83
  date.setDate(date.getDate() + 28);
84
84
  document.cookie =
85
85
  "activeDeveloperAccount=" +
86
- selectedAccount?.id +
86
+ props?.selectedAccount?.id +
87
87
  `; domain=${
88
88
  window.location.href.includes("localhost")
89
89
  ? ".localhost"
90
90
  : ".learngual.com"
91
91
  }; path=/; expires=${date.toUTCString()};`;
92
92
  }
93
- }, [selectedAccount]);
93
+ }, [props?.selectedAccount]);
94
94
  return (
95
95
  <>
96
96
  <AccountDropdownLayout>
97
97
  <AccountDropdownHeader>
98
98
  <div className="img_div">
99
99
  <img
100
- src={selectedAccount?.profile_photo || props?.avatar}
100
+ src={props?.selectedAccount?.profile_photo || props?.avatar}
101
101
  alt="account photo"
102
102
  />
103
103
  </div>
104
104
  <div>
105
105
  <h1>
106
106
  {" "}
107
- {selectedAccount?.display_name ||
108
- selectedAccount?.metadata?.organization_name ||
109
- props.activeAccountName}
107
+ {props?.selectedAccount?.display_name ||
108
+ props?.selectedAccount?.metadata?.organization_name ||
109
+ props?.activeAccountName}
110
110
  </h1>
111
111
  <h2 style={{ textTransform: "capitalize" }}>
112
- {selectedAccount?.type || props.activeAccountType}{" "}
112
+ {props?.selectedAccount?.type || props.activeAccountType}{" "}
113
113
  </h2>
114
114
  </div>
115
115
  <CloseIcon onClick={(e) => props.setIsOpen(!props.isOpen)} />
@@ -124,7 +124,7 @@ const AccountDropdown = (props) => {
124
124
  <div
125
125
  className="account-info"
126
126
  onClick={() => {
127
- setSelectedAccount(personalItem);
127
+ props?.setSelectedAccount(personalItem);
128
128
  if (window.location.port) {
129
129
  window.location.href = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/personal`;
130
130
  } else {
@@ -154,7 +154,7 @@ const AccountDropdown = (props) => {
154
154
  <div
155
155
  className="account-info"
156
156
  onClick={() => {
157
- setSelectedAccount(developerItem);
157
+ props?.setSelectedAccount(developerItem);
158
158
 
159
159
  if (
160
160
  window.location.port &&
@@ -191,7 +191,7 @@ const AccountDropdown = (props) => {
191
191
  <div
192
192
  className="account-info"
193
193
  onClick={() => {
194
- setSelectedAccount(instructorItem);
194
+ props?.setSelectedAccount(instructorItem);
195
195
  if (window.location.port) {
196
196
  window.location.href = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/instructor`;
197
197
  } else {
@@ -224,7 +224,7 @@ const AccountDropdown = (props) => {
224
224
  <div
225
225
  className="account-info"
226
226
  onClick={() => {
227
- setSelectedAccount(enterpriseItem);
227
+ props?.setSelectedAccount(enterpriseItem);
228
228
  if (window.location.port) {
229
229
  window.location.href = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/enterprise`;
230
230
  } else {
@@ -49,13 +49,14 @@ const HeaderComponent = (props) => {
49
49
  useEffect(() => {
50
50
  setIsOpen(false);
51
51
  handleGetUserAccountsDetail();
52
- // handleGetUserDetails();
52
+ handleGetUserDetails();
53
53
  }, []);
54
54
  useEffect(() => {
55
55
  if (userAccountsDetail?.data) {
56
56
  setGeneralData((generalData) => ({
57
57
  ...generalData,
58
58
  accounts: userAccountsDetail?.data,
59
+ user: userDetails?.data,
59
60
  }));
60
61
 
61
62
  let personalArray = [];
@@ -124,7 +125,12 @@ const HeaderComponent = (props) => {
124
125
  </a>
125
126
  </li> */}
126
127
  <li>
127
- <a href="#">
128
+ <a
129
+ onClick={() => {
130
+ window.location.href =
131
+ "https://developer-staging-01.learngual.com/settings/payment";
132
+ }}
133
+ >
128
134
  <SettingIcon /> Settings
129
135
  </a>
130
136
  </li>
@@ -196,6 +202,8 @@ const HeaderComponent = (props) => {
196
202
  isOpen={isOpen}
197
203
  setIsOpen={setIsOpen}
198
204
  data={userAccountsDetail}
205
+ selectedAccount={selectedAccount}
206
+ setSelectedAccount={setSelectedAccount}
199
207
  />
200
208
  )}
201
209
  </Navbar>
@@ -28,3 +28,4 @@ export { default as Calender } from "./calender/input";
28
28
  export { default as ErrorPage } from "./errorPage";
29
29
  export { default as AppMainLayout } from "./AppMainLayout";
30
30
  export { OutletContext as OutletContext } from "./AppMainLayout";
31
+ export { default as DatePickerCalender } from "./datePicker";
@@ -9,12 +9,17 @@ import {
9
9
  SuggestionItem,
10
10
  Container,
11
11
  OptionIcon,
12
+ OptionIconSearch,
12
13
  } from "./styles";
14
+ import { SearchFilterIcon } from "./svg/searchFilter";
15
+ import { SearchSvg } from "./svg/search-normal";
13
16
 
14
17
  const SearchBar = ({
15
18
  onSubmit,
16
19
  warning,
17
20
  asyncResult,
21
+ inFilter,
22
+ outFilter,
18
23
  ...restProps
19
24
  }) => {
20
25
  const [searchValue, setSearchValue] = useState("");
@@ -49,20 +54,23 @@ const SearchBar = ({
49
54
  return (
50
55
  <Container>
51
56
  <SearchBarContainer
52
- heightSize={restProps.heightSize}
53
- widthSize={restProps.widthSize}
54
- borderRadius={restProps.borderRadius}
55
- border={restProps.border}
56
- outlineColor={restProps.outlineColor}
57
+ heightSize={restProps.heightSize}
58
+ widthSize={restProps.widthSize}
59
+ borderRadius={restProps.borderRadius}
60
+ border={restProps.border}
61
+ outlineColor={restProps.outlineColor}
57
62
  >
58
63
  <SearchIcon
59
- onClick={(e) => {
60
- e.preventDefault();
61
- onSubmit(searchValue);
62
- }}/>
64
+ onClick={(e) => {
65
+ e.preventDefault();
66
+ onSubmit(searchValue);
67
+ }}>
68
+ <SearchSvg/>
69
+ </SearchIcon>
70
+
63
71
  <SearchInput
64
72
  type="search"
65
- placeholder={restProps.placeholder || "Search"}
73
+ placeholder={restProps.placeholder || "Search by Name / Email / Username"}
66
74
  value={searchValue}
67
75
  onChange={handleInputChange}
68
76
  onKeyPress={handleEnterPress}
@@ -84,8 +92,13 @@ const SearchBar = ({
84
92
  </SuggestionList>
85
93
  )}
86
94
  {warning && <WarningText>{warning}</WarningText>}
95
+ {inFilter &&
96
+ <SearchFilterIcon />
97
+ }
87
98
  </SearchBarContainer>
88
- <OptionIcon />
99
+ {outFilter &&
100
+ <SearchFilterIcon />
101
+ }
89
102
  </Container>
90
103
  );
91
104
  };
@@ -99,6 +112,7 @@ SearchBar.propTypes = {
99
112
  borderRadius: PropTypes.string,
100
113
  border: PropTypes.string,
101
114
  outlineColor: PropTypes.string,
115
+ inFilter: PropTypes.bool
102
116
  };
103
117
 
104
118
  // SearchBar.defaultProps = {
@@ -1,12 +1,16 @@
1
1
  import styled from "styled-components";
2
2
  import { FiSearch } from "react-icons/fi";
3
3
  import { RiEqualizerLine } from "react-icons/ri";
4
+ import { SearchFilterIcon } from "../svg/searchFilter";
5
+ import { SearchSvg } from "../svg/search-normal";
4
6
 
5
7
  export const Container = styled.div`
6
8
  display: flex;
7
9
  // justify-content: center;
8
10
  align-items: center;
9
11
  gap: 10px;
12
+ position: relative
13
+
10
14
  `;
11
15
 
12
16
  export const SearchBarContainer = styled.div`
@@ -24,9 +28,14 @@ export const SearchBarContainer = styled.div`
24
28
  box-shadow: 0 0 0 1px ${({ outlineColor }) => outlineColor || "#FEBF10"};
25
29
  transform: scale(1.01);
26
30
  }
31
+
32
+ svg{
33
+ margin-right: 20px;
34
+ // display: ${({display}) => display || "none"}
35
+ }
27
36
  `;
28
37
 
29
- export const SearchIcon = styled(FiSearch)`
38
+ export const SearchIcon = styled.div`
30
39
  position: absolute;
31
40
  margin-left: 12px;
32
41
  color: #ADB3B3;
@@ -45,7 +54,10 @@ export const SearchInput = styled.input`
45
54
  color: #333333;
46
55
  outline: none;
47
56
  &::placeholder {
48
- color: #ADB3B3;
57
+ font-weight: 600;
58
+ font-size: 16px;
59
+ line-height: 22px;
60
+ color: #ADB3B3;
49
61
  }
50
62
  `;
51
63
 
@@ -83,7 +95,16 @@ export const SuggestionItem = styled.li`
83
95
  }
84
96
  `;
85
97
 
86
- export const OptionIcon = styled(RiEqualizerLine)`
98
+ export const OptionIcon = styled(SearchFilterIcon)`
87
99
  color: ${({ outlineColor }) => outlineColor || "#ADB3B3"};
88
- font-size: 16px;
100
+ font-size: 18px;
101
+ display: none;
102
+
103
+ `;
104
+
105
+ export const OptionIconSearch = styled(SearchFilterIcon)`
106
+ color: ${({ outlineColor }) => outlineColor || "#ADB3B3"};
107
+ font-size: 18px;
108
+ margin-right: 30px;
109
+ visibility: hidden;
89
110
  `;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+
3
+ export const SearchSvg = ({ width, height, fill }) => (
4
+
5
+ <svg
6
+ width="22"
7
+ height="22"
8
+ viewBox="0 0 25 24"
9
+ fill="none"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ >
12
+ <path d="M12.2969 21C17.5436 21 21.7969 16.7467 21.7969 11.5C21.7969 6.25329 17.5436 2 12.2969 2C7.05017 2 2.79688 6.25329 2.79688 11.5C2.79688 16.7467 7.05017 21 12.2969 21Z" stroke="#ADB3B3" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
13
+ <path d="M22.7969 22L20.7969 20" stroke="#ADB3B3" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
14
+ </svg>
15
+
16
+ )
17
+
18
+
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+
3
+ export const SearchFilterIcon = () => (
4
+ <svg
5
+ width="25"
6
+ height="24"
7
+ viewBox="0 0 25 24"
8
+ fill="none"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ >
11
+ <path d="M22.7969 6.5H16.7969" stroke="#ADB3B3" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
12
+ <path d="M6.79688 6.5H2.79688" stroke="#ADB3B3" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
13
+ <path d="M10.7969 10C12.7299 10 14.2969 8.433 14.2969 6.5C14.2969 4.567 12.7299 3 10.7969 3C8.86388 3 7.29688 4.567 7.29688 6.5C7.29688 8.433 8.86388 10 10.7969 10Z" stroke="#ADB3B3" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
14
+ <path d="M22.7969 17.5H18.7969" stroke="#ADB3B3" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
15
+ <path d="M8.79688 17.5H2.79688" stroke="#ADB3B3" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
16
+ <path d="M14.7969 21C16.7299 21 18.2969 19.433 18.2969 17.5C18.2969 15.567 16.7299 14 14.7969 14C12.8639 14 11.2969 15.567 11.2969 17.5C11.2969 19.433 12.8639 21 14.7969 21Z" stroke="#ADB3B3" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
17
+ </svg>
18
+
19
+ )
@@ -19,7 +19,7 @@ const SideMenu = ({
19
19
  routes,
20
20
  userType,
21
21
  onLogout = () => {},
22
- isOpen = false,
22
+ isOpen,
23
23
  setIsOpen,
24
24
  }) => {
25
25
  // const [isOpen, setIsOpen] = useState(false);
@@ -38,11 +38,24 @@ const SideMenu = ({
38
38
 
39
39
  return (
40
40
  <NavigationItemContainer
41
- to={route.path}
41
+ onClick={() => {
42
+ if (
43
+ window.location.hostname.includes("staging") &&
44
+ window.location.hostname.includes("developer")
45
+ ) {
46
+ window.location.href = `developer-staging-01.learngual.com/${path}`;
47
+ } else if (window.location.hostname.includes("localhost")) {
48
+ window.location.href = `http://localhost:${window.location.port}${path}`;
49
+ } else if (
50
+ window.location.hostname.includes("developer") &&
51
+ !window.location.hostname.includes("staging")
52
+ ) {
53
+ window.location.href = `developer.learngual.com/${path}`;
54
+ }
55
+ }}
56
+ // to={route.path}
42
57
  key={index}
43
- className={cx(`${route.text}`, ({ isActive, isPending }) => {
44
- isActive ? "active" : "";
45
- })}
58
+ className={cx(`${route.text} ${active ? "active" : ""}`)}
46
59
  minimal={isOpen}
47
60
  >
48
61
  <IconContainer active={active}>{icon}</IconContainer>
@@ -39,7 +39,7 @@ export const NavigationContainer = styled.div`
39
39
  justify-content: center;
40
40
  margin-top: 20px;
41
41
  `;
42
- export const NavigationItemContainer = styled(NavLink)`
42
+ export const NavigationItemContainer = styled.p`
43
43
  text-decoration: none;
44
44
  display: flex;
45
45
  align-items: center;