l-min-components 1.7.1366 → 1.7.1368

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.7.1366",
3
+ "version": "1.7.1368",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -43,6 +43,8 @@ import AffiliateRightBar from "../fileRightBar/instructorRightBar2/affiliateRigh
43
43
  import instructorImage from "../../assets/images/instructor.png";
44
44
  import PersonalRightBar from "../fileRightBar/instructorRightBar2/personalRightBar";
45
45
  import TestModal from "../fileRightBar/instructorRightBar2/testModal";
46
+ import BlankState from "../dashboardState/blankState";
47
+ import PendingDeleteState from "../dashboardState/pendingDeleteState";
46
48
 
47
49
  const AppMainLayout = ({ children }) => {
48
50
  const [isOpen, setIsOpen] = useState(true);
@@ -333,6 +335,8 @@ const AppMainLayout = ({ children }) => {
333
335
  handleGetStorageSummary();
334
336
  }, [generalData?.selectedAccount]);
335
337
 
338
+ const accountIsPendingDeletion = generalData?.selectedAccount?.pending_delete;
339
+
336
340
  return (
337
341
  <OutletContext.Provider
338
342
  value={{
@@ -430,41 +434,56 @@ const AppMainLayout = ({ children }) => {
430
434
  setIsAffiliateLoading={setIsAffiliateLoading}
431
435
  />
432
436
  )}
433
-
434
- {window.location.pathname.includes("enterprise") &&
435
- (planState === "GRACE PERIOD" ||
436
- planState === "EXPIRED" ||
437
- (!userPlanData?.loading && !planState)) &&
438
- !window.location.pathname.includes("file-m") ? (
439
- <GracePeriod
440
- getCurrentSubscriptionData={getCurrentSubscriptionData}
441
- handleCurrentSubscription={handleCurrentSubscription}
442
- gracePeriod={gracePeriod}
443
- stateType={planState === "GRACE PERIOD" ? 1 : 2}
437
+ {!generalData?.selectedAccount ? (
438
+ <BlankState />
439
+ ) : accountIsPendingDeletion &&
440
+ !window.location.pathname.includes("settings") ? (
441
+ <PendingDeleteState
442
+ deleteDate={
443
+ generalData?.selectedAccount?.pending_delete_datetime
444
+ }
444
445
  />
445
- ) : window.location.pathname.includes("instructor") &&
446
- !planState &&
447
- !userPlanData?.loading &&
448
- !isAffiliateLoading &&
449
- !affiliateAccount?.id &&
450
- !window.location.pathname.includes("notif") ? (
451
- <div className="instructor_expired">
452
- <h1>Dashboard</h1>
453
- <div className="instructor_expired_body">
454
- <div className="instructor_expired_center">
455
- <img src={instructorImage} alt="" />
456
- <h4>
457
- You haven’t been added to an enterprise account yet
458
- </h4>
459
- <p>
460
- This account will be active once an enterprise
461
- assigns you as an instructor.
462
- </p>
463
- </div>
464
- </div>
465
- </div>
466
446
  ) : (
467
- children ?? <Outlet />
447
+ <>
448
+ {window.location.pathname.includes("enterprise") &&
449
+ (planState === "GRACE PERIOD" ||
450
+ planState === "EXPIRED" ||
451
+ (!userPlanData?.loading && !planState)) &&
452
+ !window.location.pathname.includes("file-m") ? (
453
+ <GracePeriod
454
+ getCurrentSubscriptionData={
455
+ getCurrentSubscriptionData
456
+ }
457
+ handleCurrentSubscription={handleCurrentSubscription}
458
+ gracePeriod={gracePeriod}
459
+ stateType={planState === "GRACE PERIOD" ? 1 : 2}
460
+ />
461
+ ) : window.location.pathname.includes("instructor") &&
462
+ !planState &&
463
+ !userPlanData?.loading &&
464
+ !isAffiliateLoading &&
465
+ !affiliateAccount?.id &&
466
+ !window.location.pathname.includes("notif") ? (
467
+ <div className="instructor_expired">
468
+ <h1>Dashboard</h1>
469
+ <div className="instructor_expired_body">
470
+ <div className="instructor_expired_center">
471
+ <img src={instructorImage} alt="" />
472
+ <h4>
473
+ You haven’t been added to an enterprise account
474
+ yet
475
+ </h4>
476
+ <p>
477
+ This account will be active once an enterprise
478
+ assigns you as an instructor.
479
+ </p>
480
+ </div>
481
+ </div>
482
+ </div>
483
+ ) : (
484
+ children ?? <Outlet />
485
+ )}
486
+ </>
468
487
  )}
469
488
  </CenterLayout>
470
489
  {showTest && (
@@ -482,6 +501,7 @@ const AppMainLayout = ({ children }) => {
482
501
  <EnterpriseRightBar
483
502
  planState={planState}
484
503
  affiliateAccount={affiliateAccount}
504
+ isPendingDelete={accountIsPendingDeletion}
485
505
  />
486
506
  ) : activeAccountType === "instructor" ? (
487
507
  // <>
@@ -499,6 +519,7 @@ const AppMainLayout = ({ children }) => {
499
519
  <AffiliateRightBar
500
520
  planState={planState}
501
521
  affiliateAccount={affiliateAccount.id}
522
+ isPendingDelete={accountIsPendingDeletion}
502
523
  />
503
524
  )
504
525
  ) : activeAccountType === "personal" ? (
@@ -89,7 +89,9 @@ export const CenterLayout = styled.div`
89
89
  align-items: center;
90
90
  justify-content: center;
91
91
  text-align: center;
92
- img{margin-bottom: 30px;}
92
+ img {
93
+ margin-bottom: 30px;
94
+ }
93
95
  h2 {
94
96
  font-weight: 700;
95
97
  font-size: 22px;
@@ -102,6 +104,7 @@ export const CenterLayout = styled.div`
102
104
  font-weight: 400;
103
105
  font-size: 16px;
104
106
  line-height: 24px;
107
+ }
105
108
  }
106
109
  }
107
110
  }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import styled from "styled-components";
3
+
4
+ const BlankState = () => {
5
+ return <Container />;
6
+ };
7
+
8
+ export default BlankState;
9
+
10
+ const Container = styled.div`
11
+ background-color: white;
12
+ height: 600px;
13
+ width: 100%;
14
+ border-radius: 30px;
15
+ `;
@@ -0,0 +1,57 @@
1
+ import styled from "styled-components";
2
+ import warning from "./images/warning-db.png";
3
+ import ButtonComponent from "../button";
4
+ import moment from "moment";
5
+ import redirectURL from "../../utils/redirectURL";
6
+
7
+ const PendingDeleteState = ({ deleteDate }) => {
8
+ const handleNav = () => {
9
+ window.location.href = redirectURL("/settings/account");
10
+ };
11
+ return (
12
+ <Container>
13
+ <Wrapper>
14
+ <img src={warning} alt="" />
15
+ <h2>This account is scheduled for deletion</h2>
16
+ <p>
17
+ Your account is currently pending deletion and will be permanently
18
+ removed on {moment(deleteDate).format("MMM DD, YYYY")}.
19
+ </p>
20
+ <ButtonComponent text="Cancel deletion" onClick={handleNav} />
21
+ </Wrapper>
22
+ </Container>
23
+ );
24
+ };
25
+
26
+ export default PendingDeleteState;
27
+
28
+ const Container = styled.div`
29
+ background-color: white;
30
+ height: 600px;
31
+ width: 100%;
32
+ border-radius: 30px;
33
+ display: grid;
34
+ place-items: center;
35
+ `;
36
+
37
+ const Wrapper = styled.div`
38
+ width: 390px;
39
+ display: flex;
40
+ flex-direction: column;
41
+ align-items: center;
42
+ text-align: center;
43
+ h2 {
44
+ font-size: 20px;
45
+ font-weight: 500;
46
+ margin-bottom: 10px;
47
+ margin-top: 30px;
48
+ }
49
+ p {
50
+ font-size: 16px;
51
+ margin-bottom: 50px;
52
+ }
53
+ button {
54
+ box-shadow: 0px 7.728px 15.457px 0px rgba(254, 191, 16, 0.25);
55
+ width: 320px;
56
+ }
57
+ `;
@@ -10,8 +10,9 @@ import "react-responsive-carousel/lib/styles/carousel.min.css"; // requires a lo
10
10
  import { Carousel as ReactCarousl } from "react-responsive-carousel";
11
11
  import BoxIcon from "./boxIcon";
12
12
  import redirectURL from "../../../utils/redirectURL";
13
+ import classNames from "classnames";
13
14
 
14
- const EnterpriseRightBar = ({ planState }) => {
15
+ const EnterpriseRightBar = ({ planState, isPendingDelete }) => {
15
16
  const {
16
17
  handleGetCoursesData,
17
18
  coursesData,
@@ -40,7 +41,10 @@ const EnterpriseRightBar = ({ planState }) => {
40
41
 
41
42
  return (
42
43
  <EnterpriseContainer
43
- className={planState === "GRACE PERIOD" ? "grace_period" : ""}
44
+ className={classNames({
45
+ grace_period: planState === "GRACE PERIOD",
46
+ pending_delete: isPendingDelete,
47
+ })}
44
48
  >
45
49
  <Banner>
46
50
  <h3>Courses ending soon</h3>
@@ -81,13 +85,17 @@ const EnterpriseRightBar = ({ planState }) => {
81
85
  <Button
82
86
  type="primary"
83
87
  text="Create Course"
84
- disabled={planState === "GRACE PERIOD"}
88
+ disabled={planState === "GRACE PERIOD" || isPendingDelete}
85
89
  styles={{
86
90
  fontSize: "16px",
87
91
  gap: "8px",
88
92
  padding: "20px 6px",
89
93
  height: "40px",
90
- boxShadow: "0px 10px 20px 0px rgba(254, 191, 16, 0.25)",
94
+ boxShadow: isPendingDelete
95
+ ? undefined
96
+ : "0px 10px 20px 0px rgba(254, 191, 16, 0.25)",
97
+
98
+ opacity: isPendingDelete ? 0.6 : undefined,
91
99
  }}
92
100
  onClick={() => {
93
101
  window.location.href = redirectURL(
@@ -100,6 +108,7 @@ const EnterpriseRightBar = ({ planState }) => {
100
108
  UpgradeClick={() => {
101
109
  window.location.href = redirectURL("/settings/payment");
102
110
  }}
111
+ isPendingDelete={isPendingDelete}
103
112
  planState={planState}
104
113
  siotCount={slotData?.total}
105
114
  remainingSlot={slotData?.remaining}
@@ -186,6 +195,12 @@ const EnterpriseContainer = styled.div`
186
195
  }
187
196
  }
188
197
  }
198
+
199
+ /// pending deletion
200
+ &.pending_delete {
201
+ background-color: #dfe5e5;
202
+ }
203
+
189
204
  height: 600px;
190
205
  width: 231px;
191
206
  padding: 20px 12px;
@@ -5,6 +5,7 @@ import Button from "../../button";
5
5
  import EnterpriseUpgrade from "../assets/yellow-lock.png";
6
6
  import Staricon from "../assets/star";
7
7
  import styled from "styled-components";
8
+ import classNames from "classnames";
8
9
 
9
10
  const UpgradeComponent = ({
10
11
  UpgradeClick,
@@ -12,13 +13,15 @@ const UpgradeComponent = ({
12
13
  siotCount = 0,
13
14
  remainingSlot = 0,
14
15
  data,
16
+ isPendingDelete,
15
17
  }) => {
16
18
  const lowSlot = data && remainingSlot < 1;
17
19
  return (
18
20
  <Upgrade
19
- className={`${
20
- planState === "GRACE PERIOD" ? "deactivated" : ""
21
- } more-slot `}
21
+ className={classNames("more-slot", {
22
+ deactivated: planState === "GRACE PERIOD",
23
+ "pending-delete_upgrade": isPendingDelete,
24
+ })}
22
25
  >
23
26
  <div className={`container ${lowSlot ? "red" : ""}`}>
24
27
  <img src={EnterpriseUpgrade} alt="upgrad box" />
@@ -53,7 +56,7 @@ const UpgradeComponent = ({
53
56
  <Button
54
57
  type="primary"
55
58
  text="Buy Slot"
56
- disabled={planState === "GRACE PERIOD"}
59
+ disabled={planState === "GRACE PERIOD" || isPendingDelete}
57
60
  styles={{
58
61
  marginTop: "12px",
59
62
  fontSize: "16px",
@@ -61,7 +64,9 @@ const UpgradeComponent = ({
61
64
  height: "38.641px",
62
65
  gap: "8px",
63
66
  padding: "15.457px 30.913px",
64
- boxShadow: "0px 10px 20px 0px rgba(254, 191, 16, 0.25)",
67
+ boxShadow: isPendingDelete
68
+ ? undefined
69
+ : "0px 10px 20px 0px rgba(254, 191, 16, 0.25)",
65
70
  }}
66
71
  onClick={UpgradeClick}
67
72
  />
@@ -11,8 +11,13 @@ import { Carousel as ReactCarousl } from "react-responsive-carousel";
11
11
  import BoxIcon from "./boxIcon";
12
12
  import InstructorMessage from "./messageSection";
13
13
  import redirectURL from "../../../utils/redirectURL";
14
+ import classNames from "classnames";
14
15
 
15
- const AffiliateRightBar = ({ planState, affiliateAccount }) => {
16
+ const AffiliateRightBar = ({
17
+ planState,
18
+ affiliateAccount,
19
+ isPendingDelete,
20
+ }) => {
16
21
  const { handleGetCoursesAffilateData, coursesAffilateData } = api();
17
22
 
18
23
  useEffect(() => {
@@ -40,7 +45,10 @@ const AffiliateRightBar = ({ planState, affiliateAccount }) => {
40
45
 
41
46
  return (
42
47
  <EnterpriseContainer
43
- className={planState === "GRACE PERIOD" ? "grace_period" : ""}
48
+ className={classNames({
49
+ grace_period: planState === "GRACE PERIOD",
50
+ pending_delete: isPendingDelete,
51
+ })}
44
52
  >
45
53
  <Banner>
46
54
  <h3>Courses ending soon</h3>
@@ -79,6 +87,7 @@ const AffiliateRightBar = ({ planState, affiliateAccount }) => {
79
87
 
80
88
  <InstructorMessage
81
89
  disabled={planState === "GRACE PERIOD"}
90
+ isPendingDelete={isPendingDelete}
82
91
  messsage="Create an instructor account to onboard and manage your students with our AI powered platform."
83
92
  btnText="Create account"
84
93
  onClick={() => {
@@ -167,6 +176,12 @@ const EnterpriseContainer = styled.div`
167
176
  }
168
177
  }
169
178
  }
179
+
180
+ /// pending deletion
181
+ &.pending_delete {
182
+ background-color: #dfe5e5;
183
+ }
184
+
170
185
  height: 580px;
171
186
  width: 231px;
172
187
  padding: 20px 12px;
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import img from "../../../assets/images/happy-celebrate.png";
3
3
  import styled from "styled-components";
4
4
  import ButtonComponent from "../../button";
5
+ import classNames from "classnames";
5
6
 
6
7
  const InstructorMessage = ({
7
8
  messsage,
@@ -11,9 +12,14 @@ const InstructorMessage = ({
11
12
  onClick,
12
13
  hideBtn,
13
14
  title,
15
+ isPendingDelete,
14
16
  }) => {
15
17
  return (
16
- <Container>
18
+ <Container
19
+ className={classNames({
20
+ "pending-delete_upgrade": isPendingDelete,
21
+ })}
22
+ >
17
23
  <ImageSection>
18
24
  <img src={img} alt="" />
19
25
  </ImageSection>
@@ -27,7 +33,7 @@ const InstructorMessage = ({
27
33
  {!hideBtn && (
28
34
  <div>
29
35
  <ButtonComponent
30
- disabled={disabled}
36
+ disabled={disabled || isPendingDelete}
31
37
  type="primary"
32
38
  text={btnText}
33
39
  onClick={onClick}
@@ -38,7 +44,9 @@ const InstructorMessage = ({
38
44
  gap: "8px",
39
45
  padding: "15.457px 30.913px",
40
46
  height: "38.641px",
41
- boxShadow: "0px 7.728px 15.457px 0px rgba(254, 191, 16, 0.25)",
47
+ boxShadow: isPendingDelete
48
+ ? undefined
49
+ : "0px 7.728px 15.457px 0px rgba(254, 191, 16, 0.25)",
42
50
  }}
43
51
  />
44
52
  </div>
@@ -60,6 +68,9 @@ const Container = styled.div`
60
68
  display: flex;
61
69
  flex-direction: column;
62
70
  gap: 22px;
71
+ &.pending-delete_upgrade {
72
+ opacity: 0.5;
73
+ }
63
74
  `;
64
75
 
65
76
  const ImageSection = styled.div`
@@ -93,7 +104,6 @@ const Bottom = styled.div`
93
104
  button {
94
105
  &:disabled {
95
106
  background: #949999;
96
- box-shadow: 0px 10px 20px 0px rgba(254, 191, 16, 0.25);
97
107
  }
98
108
  }
99
109
  `;
@@ -210,6 +210,9 @@ export const Upgrade = styled.div`
210
210
  align-items: flex-end;
211
211
  }
212
212
 
213
+ &.pending-delete_upgrade {
214
+ opacity: 0.5;
215
+ }
213
216
  .container {
214
217
  /* background-color: #fff; */
215
218
  border-radius: 23.185px;
@@ -69,8 +69,10 @@ const AccountDropdown = (props) => {
69
69
  {findAccountNames(props?.selectedAccount)}
70
70
  </h1>
71
71
  <h2 style={{ textTransform: "capitalize" }}>
72
- {props?.selectedAccount?.type?.toLowerCase() ||
73
- props.activeAccountType}{" "}
72
+ {props?.selectedAccount?.type?.toLowerCase() === "personal"
73
+ ? "Student"
74
+ : props?.selectedAccount?.type?.toLowerCase() ||
75
+ props.activeAccountType}{" "}
74
76
  </h2>
75
77
  </div>
76
78
  </AccountDropdownHeader>
@@ -251,7 +253,7 @@ const AccountDropdown = (props) => {
251
253
  // dont show personal accounts for developer user
252
254
  props?.personalAccountData?.length > 0 && (
253
255
  <div>
254
- <h3 style={{ marginBottom: 10 }}>Personal account</h3>
256
+ <h3 style={{ marginBottom: 10 }}>Student account</h3>
255
257
  {props?.personalAccountData?.map((personalItem, idx) => (
256
258
  <div
257
259
  className={`account-info ${
@@ -577,7 +577,9 @@ const HeaderComponent = (props) => {
577
577
  <div className="user-info-container">
578
578
  <h5 style={{ textTransform: "capitalize" }}>{accountName}</h5>
579
579
  <h6 style={{ textTransform: "capitalize" }}>
580
- {props?.selectedAccount?.type?.toLowerCase()}
580
+ {props?.selectedAccount?.type?.toLowerCase() === "personal"
581
+ ? "Student"
582
+ : props?.selectedAccount?.type?.toLowerCase()}
581
583
  </h6>
582
584
  </div>
583
585
  <ArrowDownIcon width={16} height={10} />
@@ -243,6 +243,8 @@ export const UserProfile = styled.div`
243
243
  .user-img-container {
244
244
  width: 37px;
245
245
  height: 37px;
246
+ border-radius: 50%;
247
+ overflow: hidden;
246
248
 
247
249
  img {
248
250
  width: 100%;
@@ -366,6 +368,8 @@ export const AccountDropdownHeader = styled.div`
366
368
  display: flex;
367
369
  justify-content: center;
368
370
  align-items: center;
371
+ overflow: hidden;
372
+ border-radius: 50%;
369
373
  img {
370
374
  width: 100%;
371
375
  height: 100%;
@@ -427,6 +431,12 @@ export const AccountDropdownBody = styled.div`
427
431
  & .avatar-container {
428
432
  width: 30px;
429
433
  height: 30px;
434
+ overflow: hidden;
435
+ border-radius: 50%;
436
+ img {
437
+ width: 100%;
438
+ height: 100%;
439
+ }
430
440
  }
431
441
 
432
442
  & .account-info {
@@ -52,9 +52,7 @@ const SideMenu = ({
52
52
  window.location.hostname.includes("staging");
53
53
 
54
54
  // When pending delete and on staging
55
- const isPendingDelete =
56
- generalData?.selectedAccount?.pending_delete === true &&
57
- window.location.hostname.includes("staging");
55
+ const isPendingDelete = generalData?.selectedAccount?.pending_delete === true;
58
56
 
59
57
  useEffect(() => {
60
58
  if (userType) {
@@ -288,7 +286,12 @@ const SideMenu = ({
288
286
  }
289
287
  }}
290
288
  key={index}
291
- className={cx({ active, [route.text]: true, disabled: route.disabled })}
289
+ className={cx({
290
+ active,
291
+ [route.text]: true,
292
+ disabled: route.disabled || isPendingDelete,
293
+ pending_delete_item: isPendingDelete,
294
+ })}
292
295
  minimal={isOpen}
293
296
  >
294
297
  <IconContainer active={active}>
@@ -297,7 +300,12 @@ const SideMenu = ({
297
300
  <TextContainer minimal={isOpen}>{findText(text)}</TextContainer>
298
301
 
299
302
  {!!notifications && (
300
- <NotificationCount minimal={isOpen}>
303
+ <NotificationCount
304
+ minimal={isOpen}
305
+ className={cx({
306
+ pending_delete_item: isPendingDelete,
307
+ })}
308
+ >
301
309
  <div className="text">{notificationCount}</div>
302
310
  </NotificationCount>
303
311
  )}
@@ -309,20 +317,18 @@ const SideMenu = ({
309
317
  <SideMenuContainer
310
318
  isOpen={isOpen}
311
319
  className={
312
- planState === "EXPIRED" &&
313
- generalData?.selectedAccount?.type?.toLowerCase() === "enterprise"
320
+ isPendingDelete
321
+ ? "pending_delete"
322
+ : planState === "EXPIRED" &&
323
+ generalData?.selectedAccount?.type?.toLowerCase() === "enterprise"
314
324
  ? "grace_period disabled"
315
325
  : ""
316
326
  }
317
327
  >
318
328
  <UserCard user={user} isOpen={isOpen} findText={findText} />
319
- {!isPendingDelete && (
320
- <>
321
- <NavigationContainer>
322
- {routeFilter && routeFilter?.map(renderNavigationItem)}
323
- </NavigationContainer>
324
- </>
325
- )}
329
+ <NavigationContainer>
330
+ {routeFilter && routeFilter?.map(renderNavigationItem)}
331
+ </NavigationContainer>
326
332
  <LogoutButtonContainer onClick={onLogout}>
327
333
  <IconContainer>{/* <CiLogout /> */}</IconContainer>
328
334
  {/* <TextContainer minimal={isOpen}>Log out</TextContainer> */}
@@ -23,6 +23,9 @@ export const SideMenuContainer = styled.div`
23
23
  border-radius: 30px;
24
24
  margin-left: 77px;
25
25
 
26
+ &.pending_delete {
27
+ background-color: #c6cccc;
28
+ }
26
29
  &.disabled {
27
30
  pointer-events: none;
28
31
  }
@@ -102,7 +105,15 @@ export const NavigationItemContainer = styled.p`
102
105
  background: #febf10;
103
106
  }
104
107
  }
105
-
108
+ &.pending_delete_item {
109
+ opacity: 0.8 !important;
110
+ &.active {
111
+ background-color: #949999;
112
+ &::before {
113
+ background-color: #949999;
114
+ }
115
+ }
116
+ }
106
117
  /* GRACE PERIOD AND DEACTIVATED */
107
118
  &.grace_period {
108
119
  background: var(--Neutral-40, #adb2b2);
@@ -164,6 +175,9 @@ export const NotificationCount = styled.div`
164
175
  width: 20px;
165
176
  height: 20px;
166
177
  margin-left: 2px;
178
+ &.pending_delete_item {
179
+ background-color: #949999;
180
+ }
167
181
 
168
182
  ${({ minimal }) =>
169
183
  minimal