l-min-components 1.0.705 → 1.0.714

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.705",
3
+ "version": "1.0.714",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -49,7 +49,8 @@ const AppMainLayout = () => {
49
49
  const [accessToken, setAccessToken] = useState("");
50
50
  const [envType, setEnvType] = useState("");
51
51
  const [newNotifications, setNewNotifications] = useState([]);
52
- const [deactivated, setDeactivated] = useState(true) // testing, until we get account setup
52
+ const [deactivated, setDeactivated] = useState(true); // testing, until we get account setup
53
+ const [gracePeriod, setGracePeriod] = useState(true); // test
53
54
 
54
55
  const {
55
56
  setDefaultAccount,
@@ -58,6 +59,8 @@ const AppMainLayout = () => {
58
59
  handleGetNotificationMarkRead,
59
60
  userPlanData,
60
61
  handleGetUserPlan,
62
+ getCurrentSubscriptionData,
63
+ handleCurrentSubscription,
61
64
  } = useHeader();
62
65
 
63
66
  useEffect(() => {
@@ -134,11 +137,11 @@ const AppMainLayout = () => {
134
137
  console.log("envType", envType);
135
138
 
136
139
  useEffect(() => {
137
- handleGetUserPlan()
138
- }, [])
140
+ handleGetUserPlan();
141
+ }, []);
139
142
 
140
143
  const currentPlan = userPlanData?.data?.current_plan;
141
- const planState = userPlanData?.data?.state
144
+ const planState = userPlanData?.data?.state;
142
145
 
143
146
  return (
144
147
  <OutletContext.Provider
@@ -191,6 +194,7 @@ const AppMainLayout = () => {
191
194
  isOpen={isOpen}
192
195
  setIsOpen={setIsOpen}
193
196
  setRightComponent={setRightComponent}
197
+ planState={planState}
194
198
  />
195
199
  )}
196
200
  </>
@@ -218,7 +222,16 @@ const AppMainLayout = () => {
218
222
  />
219
223
  )}
220
224
 
221
- {window.location.pathname.includes("enterprise") && deactivated ? <GracePeriod /> : <Outlet />}
225
+ {window.location.pathname.includes("enterprise") &&
226
+ planState === "GRACE PERIOD" ? (
227
+ <GracePeriod
228
+ getCurrentSubscriptionData={getCurrentSubscriptionData}
229
+ handleCurrentSubscription={handleCurrentSubscription}
230
+ gracePeriod={gracePeriod}
231
+ />
232
+ ) : (
233
+ <Outlet />
234
+ )}
222
235
  </CenterLayout>
223
236
 
224
237
  {rightLayout && !coming && (
@@ -226,7 +239,11 @@ const AppMainLayout = () => {
226
239
  {rightComponent ??
227
240
  (window.location.pathname.includes("enterprise") &&
228
241
  !window.location.pathname.includes("file-manager") ? (
229
- <EnterpriseRightBar />
242
+ <EnterpriseRightBar
243
+ gracePeriod={gracePeriod}
244
+ setGracePeriod={setGracePeriod}
245
+ planState={planState}
246
+ />
230
247
  ) : window.location.pathname.includes("personal/dashboard") ? (
231
248
  <PersonalRightBar />
232
249
  ) : window.location.pathname.includes("personal/addons") ? (
@@ -234,7 +251,7 @@ const AppMainLayout = () => {
234
251
  ) : window.location.pathname.includes("personal/courses") ? (
235
252
  <InstructorRightBar personal />
236
253
  ) : window.location.pathname.includes(
237
- "personal/library/selectlanguage"
254
+ "personal/library/selectlanguage",
238
255
  ) ? (
239
256
  <InstructorRightBar personal />
240
257
  ) : window.location.pathname.includes("personal/library") ? (
@@ -1,51 +1,58 @@
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
- import moment from "moment";
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
+ import moment from 'moment';
8
8
 
9
9
  const DatePickerCalender = ({
10
- borderColor,
11
- opacity,
12
- dateFormat,
13
- ...props
10
+ borderColor,
11
+ opacity,
12
+ dateFormat,
13
+ icon,
14
+ ...props
14
15
  }) => {
15
- const [dateRange, setDateRange] = useState({
16
- startDate: new Date(),
17
- endDate: new Date(),
18
- });
16
+ const [dateRange, setDateRange] = useState({
17
+ startDate: new Date(),
18
+ endDate: new Date(),
19
+ });
19
20
 
20
- return(
21
- <DatePickerWrapper {...props}>
22
- <DateCont className="datepicker__wrapper" borderColor={borderColor} opacity={opacity} >
23
- <DatePicker
24
- selected={dateRange.endDate}
25
- endDate={dateRange.endDate}
26
- dateFormat={dateFormat ? dateFormat : "d MMM yyyy"}
27
- renderCustomHeader={({ date, decreaseMonth, increaseMonth }) => (
28
- <CustomDatePickerHeader selected={date} onMonthChange={(value) => {
21
+ return (
22
+ <DatePickerWrapper {...props}>
23
+ <DateCont
24
+ className="datepicker__wrapper"
25
+ borderColor={borderColor}
26
+ opacity={opacity}
27
+ >
28
+ <DatePicker
29
+ selected={dateRange.endDate}
30
+ endDate={dateRange.endDate}
31
+ dateFormat={dateFormat ? dateFormat : 'd MMM yyyy'}
32
+ renderCustomHeader={({ date, decreaseMonth, increaseMonth }) => (
33
+ <CustomDatePickerHeader
34
+ selected={date}
35
+ onMonthChange={(value) => {
29
36
  if (value === -1) {
30
- decreaseMonth();
37
+ decreaseMonth();
31
38
  } else if (value === 1) {
32
- increaseMonth();
39
+ increaseMonth();
33
40
  }
34
- }} />
35
- )}
36
- onChange={(dates) =>
37
- setDateRange({
38
- ...dateRange,
39
- endDate: dates,
40
- })
41
- }
42
- calendarClassName="datepicker_style"
41
+ }}
43
42
  />
44
- <CalendarIcon />
45
- </DateCont>
46
- </DatePickerWrapper>
43
+ )}
44
+ onChange={(dates) =>
45
+ setDateRange({
46
+ ...dateRange,
47
+ endDate: dates,
48
+ })
49
+ }
50
+ calendarClassName="datepicker_style"
51
+ />
52
+ {icon ? icon : <CalendarIcon />}
53
+ </DateCont>
54
+ </DatePickerWrapper>
55
+ );
56
+ };
47
57
 
48
- )
49
- }
50
-
51
- export default DatePickerCalender
58
+ export default DatePickerCalender;
@@ -1,6 +1,8 @@
1
- import React from 'react';
1
+ import React, { useState } from "react";
2
2
  import { useLocation } from "react-router-dom";
3
- import styled from 'styled-components';
3
+ import styled from "styled-components";
4
+ import SubscriptionExpiredModal from "./modal/subscription-expired-modal";
5
+ import Button from "../button";
4
6
 
5
7
  const routes = [
6
8
  { path: "dashboard", title: "Dashboard" },
@@ -12,11 +14,17 @@ const routes = [
12
14
  { path: "file-manager", title: "File Manager" },
13
15
  ];
14
16
 
15
- const GracePeriod = () => {
17
+ const GracePeriod = ({
18
+ getCurrentSubscriptionData,
19
+ handleCurrentSubscription,
20
+ gracePeriod,
21
+ }) => {
16
22
  const location = useLocation();
23
+ const [subscriptionExpiredModalIsOpen, setSubscriptionExpiredModalIsOpen] =
24
+ useState(false);
17
25
 
18
26
  const getTitleFromPath = (path) => {
19
- const route = routes.find(route => path.includes(route.path));
27
+ const route = routes.find((route) => path.includes(route.path));
20
28
  return route?.title || "Dashboard";
21
29
  };
22
30
 
@@ -25,11 +33,38 @@ const GracePeriod = () => {
25
33
  return (
26
34
  <GracePeriodWrapper>
27
35
  <h1>{pageTitle}</h1>
36
+ {!gracePeriod &&
37
+ <Expire>
38
+ <h4>Hey Enterprise, You do not have any active plan</h4>
39
+
40
+ <div
41
+ onClick={() => {
42
+ window.location.href =
43
+ "https://559staging.learngual.com/settings/payment/";
44
+ }}
45
+ >
46
+ <Button
47
+ text="Choose a Plan"
48
+ styles={{
49
+ height: "35px",
50
+ padding: "4px 20px",
51
+ fontSize: "14px",
52
+ }}
53
+ />
54
+ </div>
55
+ </Expire>
56
+ }
28
57
  <div className="gracePeriod_account">
29
58
  <div className="content">
30
59
  <p>Sorry, you can’t access your account</p>
31
60
  </div>
32
61
  </div>
62
+
63
+ <SubscriptionExpiredModal
64
+ subscriptionExpiredModalIsOpen={subscriptionExpiredModalIsOpen}
65
+ setSubscriptionExpiredModalIsOpen={setSubscriptionExpiredModalIsOpen}
66
+ getCurrentSubscriptionData={getCurrentSubscriptionData}
67
+ />
33
68
  </GracePeriodWrapper>
34
69
  );
35
70
  };
@@ -79,4 +114,24 @@ const GracePeriodWrapper = styled.div`
79
114
  }
80
115
  `;
81
116
 
117
+ const Expire = styled.div`
118
+ border-radius: 25px;
119
+ background: rgba(48, 212, 104, 0.15);
120
+ display: flex;
121
+ padding: 15px 26px;
122
+ flex-direction: column;
123
+ align-items: flex-start;
124
+ gap: 10px;
125
+ margin-bottom: 20px;
126
+
127
+ h4 {
128
+ color: var(--warning, #f39b33);
129
+ font-family: Nunito;
130
+ font-size: 16px;
131
+ font-style: normal;
132
+ font-weight: 700;
133
+ line-height: 20px; /* 125% */
134
+ }
135
+ `;
136
+
82
137
  export default GracePeriod;
@@ -0,0 +1,77 @@
1
+ export const BookIcon = ({ width, height, fill }) => (
2
+ <svg
3
+ width={width || "24"}
4
+ height={height || "25"}
5
+ viewBox="0 0 24 25"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ >
9
+ <path
10
+ d="M22 16.9213V4.85134C22 3.65134 21.02 2.76134 19.83 2.86134H19.77C17.67 3.04134 14.48 4.11134 12.7 5.23134L12.53 5.34134C12.24 5.52134 11.76 5.52134 11.47 5.34134L11.22 5.19134C9.44 4.08134 6.26 3.02134 4.16 2.85134C2.97 2.75134 2 3.65134 2 4.84134V16.9213C2 17.8813 2.78 18.7813 3.74 18.9013L4.03 18.9413C6.2 19.2313 9.55 20.3313 11.47 21.3813L11.51 21.4013C11.78 21.5513 12.21 21.5513 12.47 21.4013C14.39 20.3413 17.75 19.2313 19.93 18.9413L20.26 18.9013C21.22 18.7813 22 17.8813 22 16.9213Z"
11
+ stroke="white"
12
+ strokeWidth="1.5"
13
+ strokeLinecap="round"
14
+ strokeLinejoin="round"
15
+ />
16
+ <path
17
+ d="M12 5.66797V20.668"
18
+ stroke="white"
19
+ strokeWidth="1.5"
20
+ strokeLinecap="round"
21
+ strokeLinejoin="round"
22
+ />
23
+ <path
24
+ d="M7.75 8.66797H5.5"
25
+ stroke="white"
26
+ strokeWidth="1.5"
27
+ strokeLinecap="round"
28
+ strokeLinejoin="round"
29
+ />
30
+ <path
31
+ d="M8.5 11.668H5.5"
32
+ stroke="white"
33
+ strokeWidth="1.5"
34
+ strokeLinecap="round"
35
+ strokeLinejoin="round"
36
+ />
37
+ </svg>
38
+ );
39
+
40
+ export const ErrorBookIcon = ({ width, height, fill }) => (
41
+ <svg
42
+ width={width || "26"}
43
+ height={height || "26"}
44
+ viewBox="0 0 26 26"
45
+ fill="none"
46
+ xmlns="http://www.w3.org/2000/svg"
47
+ >
48
+ <path
49
+ d="M23.2422 17.6216V5.02823C23.2422 3.7762 22.2197 2.84761 20.9781 2.95195H20.9155C18.7245 3.13975 15.3961 4.25615 13.539 5.42471L13.3616 5.53948C13.059 5.72729 12.5582 5.72729 12.2556 5.53948L11.9948 5.38298C10.1376 4.22485 6.81972 3.11889 4.62866 2.94151C3.38706 2.83718 2.375 3.7762 2.375 5.0178V17.6216C2.375 18.6232 3.18882 19.5622 4.19045 19.6874L4.49302 19.7292C6.75711 20.0318 10.2524 21.1795 12.2556 22.275L12.2974 22.2958C12.5791 22.4524 13.0277 22.4524 13.299 22.2958C15.3022 21.1899 18.8079 20.0318 21.0825 19.7292L21.4268 19.6874C22.4284 19.5622 23.2422 18.6232 23.2422 17.6216Z"
50
+ stroke="#F95454"
51
+ stroke-width="1.25203"
52
+ stroke-linecap="round"
53
+ stroke-linejoin="round"
54
+ />
55
+ <path
56
+ d="M12.8125 5.88281V21.5332"
57
+ stroke="#F95454"
58
+ stroke-width="1.25203"
59
+ stroke-linecap="round"
60
+ stroke-linejoin="round"
61
+ />
62
+ <path
63
+ d="M8.371 9.01562H6.02344"
64
+ stroke="#F95454"
65
+ stroke-width="1.25203"
66
+ stroke-linecap="round"
67
+ stroke-linejoin="round"
68
+ />
69
+ <path
70
+ d="M9.15352 12.1445H6.02344"
71
+ stroke="#F95454"
72
+ stroke-width="1.25203"
73
+ stroke-linecap="round"
74
+ stroke-linejoin="round"
75
+ />
76
+ </svg>
77
+ );
@@ -0,0 +1,222 @@
1
+ import styled from "styled-components";
2
+
3
+ export const ModalCardContainer = styled.div`
4
+ /* padding: 25px; */
5
+ font-family: "Nunito";
6
+ width: 100%;
7
+ max-width: 720px;
8
+ margin-left: 40px;
9
+ `;
10
+
11
+ export const CloseModalButton = styled.div`
12
+ background-color: rgba(255, 255, 255, 1);
13
+ width: 40px;
14
+ height: 40px;
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ padding: 10px;
19
+ font-family: "Nunito";
20
+ border-radius: 50%;
21
+ margin-bottom: 8px;
22
+ margin-left: auto;
23
+ `;
24
+
25
+ export const CardContainer = styled.div`
26
+ background-color: rgba(255, 255, 255, 1);
27
+ padding: 25px;
28
+ font-family: "Nunito";
29
+ width: 100%;
30
+ max-width: 700px;
31
+ border-radius: 30px;
32
+ `;
33
+
34
+ export const CardHeader = styled.div`
35
+ width: 100%;
36
+ text-align: center;
37
+
38
+ .cancel-title {
39
+ font-size: 22px;
40
+ color: #313333;
41
+ font-weight: 700px;
42
+ margin-bottom: 30px;
43
+ }
44
+
45
+ .title-icon {
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: center;
49
+ margin-right: 20px;
50
+ border-radius: 12px;
51
+ margin: 0 auto;
52
+ }
53
+ `;
54
+
55
+ export const CardBody = styled.div`
56
+ width: 100%;
57
+ /* display: flex; */
58
+ margin: 20px auto 10px;
59
+ text-align: center;
60
+
61
+ .mdl-title {
62
+ font-size: 22px;
63
+ font-weight: 700;
64
+ color: #313333;
65
+ margin-bottom: 12px;
66
+ }
67
+
68
+ .mdld-title {
69
+ width: 370px;
70
+ font-size: 18px;
71
+ font-weight: 700;
72
+ color: #313333;
73
+ margin: 0 auto 12px;
74
+ }
75
+
76
+ .btn__footer {
77
+ display: flex;
78
+ margin-top: 30px;
79
+ justify-content: center;
80
+
81
+ button {
82
+ width: 171px;
83
+ margin: 0 20px;
84
+ }
85
+ }
86
+ `;
87
+
88
+ export const ExpiryCardContainer = styled.div`
89
+ background-color: rgba(255, 255, 255, 1);
90
+ font-family: "Nunito";
91
+ width: 100%;
92
+ max-width: 700px;
93
+ border-radius: 30px;
94
+
95
+ .expiry_modal_container {
96
+ display: flex;
97
+ /* height: 100%; */
98
+
99
+
100
+ .logo_section {
101
+ background-color: rgba(249, 84, 84, 0.2);
102
+ display: flex;
103
+ align-items: center;
104
+ justify-content: center;
105
+ padding: 25px;
106
+ width: 40%;
107
+ padding: 0 25px;
108
+ }
109
+
110
+ .expiry_details {
111
+ padding: 25px;
112
+ width: 60%;
113
+
114
+ .error-txt {
115
+ color: #f95454;
116
+ font-weight: 800;
117
+ }
118
+ .enterprise_info {
119
+ border-radius: 12px;
120
+ padding: 10px 2px;
121
+ background-color: #f5f7f7;
122
+ width: 66px;
123
+ margin-bottom: 27px;
124
+ text-align: center;
125
+ display: flex;
126
+ flex-direction: column;
127
+ justify-content: center;
128
+ p {
129
+ color: #f95454;
130
+ font-size: 12px;
131
+ font-weight: 800;
132
+ letter-spacing: 0.28px;
133
+ text-align: center;
134
+ }
135
+ }
136
+
137
+ h6 {
138
+ color: #f95454;
139
+ font-size: 20px;
140
+ font-weight: 700;
141
+ letter-spacing: 0.4px;
142
+ margin-bottom: 15px;
143
+ text-align: left;
144
+ }
145
+
146
+ p {
147
+ color: #313333;
148
+ font-size: 16px;
149
+ font-weight: 700;
150
+ letter-spacing: 0.32px;
151
+ text-align: left;
152
+ }
153
+ }
154
+
155
+ .btn__footer {
156
+ display: flex;
157
+ margin-top: 40px;
158
+ justify-content: space-between;
159
+ }
160
+ }
161
+ `;
162
+
163
+ export const NotificationCellCardContainer = styled.div`
164
+ padding: 10px 20px 20px;
165
+ background-color: rgba(255, 255, 255, 1);
166
+ font-family: "Nunito";
167
+ border-radius: 15px;
168
+
169
+ .notification_cell_container {
170
+ display: flex;
171
+
172
+ .logo_section {
173
+ display: flex;
174
+ align-items: self-start;
175
+ justify-content: center;
176
+ width: 75px;
177
+
178
+ p {
179
+ border-radius: 8px;
180
+ background: rgba(254, 191, 16, 0.1);
181
+ padding: 8px;
182
+ }
183
+ }
184
+
185
+ .nc_details {
186
+ padding-left: 15px;
187
+ .error-txt {
188
+ color: #f95454;
189
+ font-weight: 800;
190
+ font-style: italic;
191
+ }
192
+
193
+ h6 {
194
+ color: #f39b33;
195
+ font-size: 16px;
196
+ font-weight: 700;
197
+ margin-bottom: 8px;
198
+ text-align: left;
199
+ }
200
+
201
+ p {
202
+ color: #636666;
203
+ font-size: 14px;
204
+ font-weight: 700;
205
+ text-align: left;
206
+ }
207
+ }
208
+
209
+ .btn__footer {
210
+ display: flex;
211
+ margin-top: 20px;
212
+ justify-content: space-between;
213
+ }
214
+ }
215
+ `;
216
+
217
+ export const NotificationCellModalContainer = styled.div`
218
+ /* padding: 25px; */
219
+ font-family: "Nunito";
220
+ width: 100%;
221
+ max-width: 800px;
222
+ `;