l-min-components 1.0.1108 → 1.0.1117

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.1108",
3
+ "version": "1.0.1117",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -218,6 +218,8 @@ const AppMainLayout = () => {
218
218
  translateData,
219
219
  } = useTranslation(wordBank);
220
220
 
221
+ // use this to check if we're on the demo app and remove most of the navbar items except the demo icon and text
222
+ const isDemo = window.location.hostname.includes("demo");
221
223
  return (
222
224
  <OutletContext.Provider
223
225
  value={{
@@ -273,23 +275,24 @@ const AppMainLayout = () => {
273
275
  <MainLayout coming={coming}>
274
276
  <LeftLayout>
275
277
  <SideBar routes={leftNavMenu} findText={findText} />
276
- {!coming && (
277
- <>
278
- {sideMenuLayout && (
279
- <SideMenu
280
- user={user}
281
- routes={sideMenuOptions}
282
- affiliatesActive={affiliateAccount}
283
- userType={generalData?.selectedAccount?.type?.toLowerCase()}
284
- isOpen={isOpen}
285
- setIsOpen={setIsOpen}
286
- setRightComponent={setRightComponent}
287
- planState={planState}
288
- findText={findText}
289
- />
290
- )}
291
- </>
292
- )}
278
+ {!coming &&
279
+ !isDemo(
280
+ <>
281
+ {sideMenuLayout && (
282
+ <SideMenu
283
+ user={user}
284
+ routes={sideMenuOptions}
285
+ affiliatesActive={affiliateAccount}
286
+ userType={generalData?.selectedAccount?.type?.toLowerCase()}
287
+ isOpen={isOpen}
288
+ setIsOpen={setIsOpen}
289
+ setRightComponent={setRightComponent}
290
+ planState={planState}
291
+ findText={findText}
292
+ />
293
+ )}
294
+ </>
295
+ )}
293
296
  {
294
297
  // window.location.pathname.includes("enterprise")
295
298
  // ? "enterprise"
@@ -326,7 +329,7 @@ const AppMainLayout = () => {
326
329
  )}
327
330
  </CenterLayout>
328
331
 
329
- {rightLayout && !coming && (
332
+ {rightLayout && !coming && !isDemo && (
330
333
  <RightLayout>
331
334
  {rightComponent ??
332
335
  (window.location.pathname.includes("enterprise") &&
@@ -0,0 +1,18 @@
1
+ const CompuetrerIcon = () => {
2
+ return (
3
+ <svg
4
+ width="23"
5
+ height="17"
6
+ viewBox="0 0 23 17"
7
+ fill="none"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ >
10
+ <path
11
+ d="M19.1667 14.3483C20.2208 14.3483 21.0737 13.4858 21.0737 12.4316L21.0833 2.84831C21.0833 1.79414 20.2208 0.931641 19.1667 0.931641H3.83333C2.77917 0.931641 1.91667 1.79414 1.91667 2.84831V12.4316C1.91667 13.4858 2.77917 14.3483 3.83333 14.3483H0V16.265H23V14.3483H19.1667ZM3.83333 2.84831H19.1667V12.4316H3.83333V2.84831Z"
12
+ fill="#00C2C2"
13
+ />
14
+ </svg>
15
+ );
16
+ };
17
+
18
+ export default CompuetrerIcon;
@@ -34,6 +34,7 @@ import DuetIcon from "../sideNav/svg/duetIcon";
34
34
  import SpeechIcon from "../sideNav/svg/speechIcon";
35
35
  import DictionaryIcon from "../sideNav/svg/dictionaryIcon";
36
36
  import FunIcon from "../sideNav/svg/fun";
37
+ import CompuetrerIcon from "./assets/svg/computerIcon";
37
38
 
38
39
  /**
39
40
  * @param {{
@@ -70,6 +71,7 @@ const HeaderComponent = (props) => {
70
71
  updateUserAccountData,
71
72
  handleUpdateUserAccount,
72
73
  handleGetUnreadNotificationPersonal,
74
+ handleGeneralNotificationCountPersonal
73
75
  } = useHeader();
74
76
  const { pathname } = useLocation();
75
77
  const { setGeneralData, generalData, notificationMarkReadData } =
@@ -119,7 +121,13 @@ const HeaderComponent = (props) => {
119
121
  );
120
122
 
121
123
  useEffect(() => {
122
- if (accountType) handleGeneralNotificationCount(accountType);
124
+ if (accountType && accountType !== "personal") {
125
+ handleGeneralNotificationCount(accountType);
126
+ }
127
+
128
+ if (accountType && accountType === "personal") {
129
+ handleGeneralNotificationCountPersonal()
130
+ }
123
131
  }, [accountType]);
124
132
 
125
133
  useEffect(() => {
@@ -306,11 +314,13 @@ const HeaderComponent = (props) => {
306
314
  // Determine the label based on the current path
307
315
  const getNavLinkLabel = () => {
308
316
  const path = window.location.pathname;
317
+ const hostname = window.location.hostname;
309
318
  if (path.includes("fun")) return "Fun";
310
319
  if (path.includes("community")) return "Community";
311
320
  if (path.includes("explore")) return "Explore";
312
321
  if (path.includes("connect")) return "Connect";
313
322
  if (path.includes("dictionary")) return "Dictionary";
323
+ if (hostname.includes("demo")) return "Demo";
314
324
  return props.findText("Learning");
315
325
  };
316
326
  const getNavLinkIcon = () => {
@@ -322,6 +332,7 @@ const HeaderComponent = (props) => {
322
332
  if (path.includes("connect")) return <SpeechIcon width={23} height={23} />;
323
333
  if (path.includes("dictionary"))
324
334
  return <DictionaryIcon width={23} height={23} />;
335
+ if (hostname.includes("demo")) return <CompuetrerIcon />;
325
336
  return <BookIcon width={23} height={23} />;
326
337
  };
327
338
 
@@ -426,15 +437,15 @@ const HeaderComponent = (props) => {
426
437
  }
427
438
  }, [notificationMarkReadData?.response]);
428
439
 
429
- // When Developer and on staging
430
- const isDeveloper = generalData?.selectedAccount?.type === "DEVELOPER";
431
-
432
440
  const isPendingDelete =
433
441
  generalData?.selectedAccount?.pending_delete === true &&
434
442
  window.location.hostname.includes("staging");
435
443
 
436
444
  const value = localStorage.getItem("defaultLang");
437
445
 
446
+ // use this to check if we're on the demo app and remove most of the navbar items except the demo icon and text
447
+ const isDemo = window.location.hostname.includes("demo");
448
+
438
449
  return (
439
450
  <Navbar>
440
451
  <img src={logo} alt="Learngual logo" />
@@ -446,65 +457,69 @@ const HeaderComponent = (props) => {
446
457
  >
447
458
  <li>
448
459
  <a className={isHomePage() ? "active" : ""}>
449
- {getNavLinkIcon()} {getNavLinkLabel()}
460
+ {getNavLinkIcon()} {props.findText(getNavLinkLabel())}
450
461
  </a>
451
462
  </li>
452
463
 
453
- <li>
454
- <a
455
- onClick={() => {
456
- window.location.hostname.includes("coming")
457
- ? (window.location.href =
458
- "https://www.learngual.com/settings/account")
459
- : (window.location.href = "/settings/account");
460
- }}
461
- className={
462
- window.location.pathname.includes("settings") ? "active" : ""
463
- }
464
- style={{ cursor: "pointer" }}
465
- >
466
- <SettingIcon /> {props.findText("Settings")}
467
- </a>
468
- </li>
469
- <li>
470
- <a
471
- // href={`https://559staging.learngual.com/${
472
- // selectedAccount?.type
473
- // ? selectedAccount?.type?.toLowerCase()
474
- // : userAccountsDetail?.data?.[0]?.type?.toLowerCase()
475
- // }/notifications/`}
476
-
477
- onClick={(e) => {
478
- if (isPendingDelete) {
479
- e.preventDefault();
480
- e.stopPropagation();
481
- } else {
482
- window.location.hostname.includes("coming")
483
- ? (window.location.href = `https://www.learngual.com/auth/sign-in`)
484
- : (window.location.href = `/${
485
- selectedAccount?.type
486
- ? selectedAccount?.type?.toLowerCase()
487
- : userAccountsDetail?.data?.[0]?.type?.toLowerCase()
488
- }/notifications/`);
489
- }
490
- }}
491
- className={
492
- window.location.pathname.includes("notifications")
493
- ? "active"
494
- : isPendingDelete
495
- ? "disabled"
496
- : ""
497
- }
498
- style={{ cursor: isPendingDelete ? "not-allowed" : "pointer" }}
499
- >
500
- {unreadNotificationData?.data?.count > 0 ? (
501
- <NotificationIcon />
502
- ) : (
503
- <NotificationEmptyIcon />
504
- )}
505
- {props.findText("Notifications")}
506
- </a>
507
- </li>
464
+ {!isDemo && (
465
+ <>
466
+ <li>
467
+ <a
468
+ onClick={() => {
469
+ window.location.hostname.includes("coming")
470
+ ? (window.location.href =
471
+ "https://www.learngual.com/settings/account")
472
+ : (window.location.href = "/settings/account");
473
+ }}
474
+ className={
475
+ window.location.pathname.includes("settings") ? "active" : ""
476
+ }
477
+ style={{ cursor: "pointer" }}
478
+ >
479
+ <SettingIcon /> {props.findText("Settings")}
480
+ </a>
481
+ </li>
482
+ <li>
483
+ <a
484
+ // href={`https://559staging.learngual.com/${
485
+ // selectedAccount?.type
486
+ // ? selectedAccount?.type?.toLowerCase()
487
+ // : userAccountsDetail?.data?.[0]?.type?.toLowerCase()
488
+ // }/notifications/`}
489
+
490
+ onClick={(e) => {
491
+ if (isPendingDelete) {
492
+ e.preventDefault();
493
+ e.stopPropagation();
494
+ } else {
495
+ window.location.hostname.includes("coming")
496
+ ? (window.location.href = `https://www.learngual.com/auth/sign-in`)
497
+ : (window.location.href = `/${
498
+ selectedAccount?.type
499
+ ? selectedAccount?.type?.toLowerCase()
500
+ : userAccountsDetail?.data?.[0]?.type?.toLowerCase()
501
+ }/notifications/`);
502
+ }
503
+ }}
504
+ className={
505
+ window.location.pathname.includes("notifications")
506
+ ? "active"
507
+ : isPendingDelete
508
+ ? "disabled"
509
+ : ""
510
+ }
511
+ style={{ cursor: isPendingDelete ? "not-allowed" : "pointer" }}
512
+ >
513
+ {unreadNotificationData?.data?.count > 0 ? (
514
+ <NotificationIcon />
515
+ ) : (
516
+ <NotificationEmptyIcon />
517
+ )}
518
+ {props.findText("Notifications")}
519
+ </a>
520
+ </li>
521
+ </>
522
+ )}
508
523
  {/* <li style={{ marginLeft: "20%", cursor: "pointer" }}>
509
524
  <a
510
525
  onClick={() => {
@@ -525,13 +540,14 @@ const HeaderComponent = (props) => {
525
540
 
526
541
  </Help> */}
527
542
 
528
- <NavGroup
529
- onClick={() => {
530
- setLanguageDropdown();
531
- setIsOpen();
532
- }}
533
- >
534
- {/* {(!isDeveloper || !window.location.hostname.includes("coming")) && ( // when developer and on staging, don't show
543
+ {!isDemo && (
544
+ <NavGroup
545
+ onClick={() => {
546
+ setLanguageDropdown();
547
+ setIsOpen();
548
+ }}
549
+ >
550
+ {/* {(!isDeveloper || !window.location.hostname.includes("coming")) && ( // when developer and on staging, don't show
535
551
  <SearchInputGroup>
536
552
  <SearchIcon />
537
553
  <SearchInput
@@ -553,87 +569,95 @@ const HeaderComponent = (props) => {
553
569
  </SearchInputGroup>
554
570
  )} */}
555
571
 
556
- <div className="language_dropdown" onClick={(e) => e.stopPropagation()}>
557
572
  <div
558
- className="drop_holder"
559
- onClick={() => {
560
- setLanguageDropdown(!languageDropdown);
561
- setIsOpen();
562
- }}
573
+ className="language_dropdown"
574
+ onClick={(e) => e.stopPropagation()}
563
575
  >
564
- <img src={selectedLanguageData[value] || usFlag} alt="" />
565
- <ArrowDownIcon />
576
+ <div
577
+ className="drop_holder"
578
+ onClick={() => {
579
+ setLanguageDropdown(!languageDropdown);
580
+ setIsOpen();
581
+ }}
582
+ >
583
+ <img src={selectedLanguageData[value] || usFlag} alt="" />
584
+ <ArrowDownIcon />
585
+ </div>
586
+ {languageDropdown && (
587
+ <LanguageDropdown
588
+ languageDropdown={languageDropdown}
589
+ setLanguageDropdown={setLanguageDropdown}
590
+ findText={props.findText}
591
+ defaultLang={props.defaultLang}
592
+ setDefaultLang={props.setDefaultLang}
593
+ setIsTranslationsLoading={props.setIsTranslationsLoading}
594
+ />
595
+ )}
566
596
  </div>
567
- {languageDropdown && (
568
- <LanguageDropdown
569
- languageDropdown={languageDropdown}
570
- setLanguageDropdown={setLanguageDropdown}
597
+ {selectedAccount && (
598
+ <UserProfile
599
+ onClick={(e) => {
600
+ e.stopPropagation();
601
+ setIsOpen(!isOpen);
602
+ setLanguageDropdown();
603
+ }}
604
+ ref={secondContainerRef}
605
+ >
606
+ <div className="user-img-container">
607
+ <img
608
+ src={selectedAccount?.profile_photo?.url || avatar}
609
+ alt="profile"
610
+ />
611
+ </div>
612
+ <div className="user-info-container">
613
+ <h5 style={{ textTransform: "capitalize" }}>
614
+ {selectedAccount?.metadata?.organization_name ||
615
+ selectedAccount?.display_name}
616
+ </h5>
617
+ <h6 style={{ textTransform: "capitalize" }}>
618
+ {selectedAccount?.type?.toLowerCase()}
619
+ </h6>
620
+ </div>
621
+ <ArrowDownIcon width={16} height={10} />
622
+ </UserProfile>
623
+ )}
624
+ </NavGroup>
625
+ )}
626
+
627
+ {!isDemo && (
628
+ <>
629
+ {isOpen && (
630
+ <AccountDropdown
631
+ avatar={avatar}
632
+ activeAccountName={selectedAccount?.display_name}
633
+ activeAccountType={"Personal Account"}
634
+ accountName={"Default name"}
635
+ accountType={"Default Account"}
636
+ notificationCount={"5"}
637
+ isOpen={isOpen}
638
+ setIsOpen={setIsOpen}
639
+ data={userAccountsDetail}
640
+ selectedAccount={selectedAccount}
641
+ setSelectedAccount={setSelectedAccount}
642
+ developerAccountData={developerAccountData}
643
+ setDeveloperAccountData={setDeveloperAccountData}
644
+ personalAccountData={personalAccountData}
645
+ setPersonalAccountData={setPersonalAccountData}
646
+ instructorAccountData={instructorAccountData}
647
+ setInstructorAccountData={setInstructorAccountData}
648
+ enterpriseAccountData={enterpriseAccountData}
649
+ setEnterpriseAccountData={setEnterpriseAccountData}
650
+ setGeneralData={setGeneralData}
651
+ userAccountsDetail={userAccountsDetail}
652
+ userDetails={userDetails}
653
+ setDefaultAccount={setDefaultAccount}
654
+ handleSetDefaultAccount={handleSetDefaultAccount}
655
+ ref={acctDropdownContainerRef}
656
+ hasDeveloperAccount={hasDeveloperAccount}
571
657
  findText={props.findText}
572
- defaultLang={props.defaultLang}
573
- setDefaultLang={props.setDefaultLang}
574
- setIsTranslationsLoading={props.setIsTranslationsLoading}
575
658
  />
576
659
  )}
577
- </div>
578
- {selectedAccount && (
579
- <UserProfile
580
- onClick={(e) => {
581
- e.stopPropagation();
582
- setIsOpen(!isOpen);
583
- setLanguageDropdown();
584
- }}
585
- ref={secondContainerRef}
586
- >
587
- <div className="user-img-container">
588
- <img
589
- src={selectedAccount?.profile_photo?.url || avatar}
590
- alt="profile"
591
- />
592
- </div>
593
- <div className="user-info-container">
594
- <h5 style={{ textTransform: "capitalize" }}>
595
- {selectedAccount?.metadata?.organization_name ||
596
- selectedAccount?.display_name}
597
- </h5>
598
- <h6 style={{ textTransform: "capitalize" }}>
599
- {selectedAccount?.type?.toLowerCase()}
600
- </h6>
601
- </div>
602
- <ArrowDownIcon width={16} height={10} />
603
- </UserProfile>
604
- )}
605
- </NavGroup>
606
-
607
- {isOpen && (
608
- <AccountDropdown
609
- avatar={avatar}
610
- activeAccountName={selectedAccount?.display_name}
611
- activeAccountType={"Personal Account"}
612
- accountName={"Default name"}
613
- accountType={"Default Account"}
614
- notificationCount={"5"}
615
- isOpen={isOpen}
616
- setIsOpen={setIsOpen}
617
- data={userAccountsDetail}
618
- selectedAccount={selectedAccount}
619
- setSelectedAccount={setSelectedAccount}
620
- developerAccountData={developerAccountData}
621
- setDeveloperAccountData={setDeveloperAccountData}
622
- personalAccountData={personalAccountData}
623
- setPersonalAccountData={setPersonalAccountData}
624
- instructorAccountData={instructorAccountData}
625
- setInstructorAccountData={setInstructorAccountData}
626
- enterpriseAccountData={enterpriseAccountData}
627
- setEnterpriseAccountData={setEnterpriseAccountData}
628
- setGeneralData={setGeneralData}
629
- userAccountsDetail={userAccountsDetail}
630
- userDetails={userDetails}
631
- setDefaultAccount={setDefaultAccount}
632
- handleSetDefaultAccount={handleSetDefaultAccount}
633
- ref={acctDropdownContainerRef}
634
- hasDeveloperAccount={hasDeveloperAccount}
635
- findText={props.findText}
636
- />
660
+ </>
637
661
  )}
638
662
  </Navbar>
639
663
  );
@@ -70,7 +70,7 @@ const ChatHeader = ({
70
70
 
71
71
  {chatRecipient?.type === "PERSONAL" && (
72
72
  <div className="friend-tag">
73
- <HiUser /> Friend
73
+ <HiUser /> Student
74
74
  </div>
75
75
  )}
76
76
  {chatRecipient?.type === "INSTRUCTOR" && (
@@ -793,6 +793,7 @@ export const MessageBox = styled.div`
793
793
  h6 {
794
794
  font-size: 14px;
795
795
  font-weight: 400;
796
+ color: #ffffff;
796
797
  /* padding-top: 6px; */
797
798
  }
798
799
 
@@ -43,6 +43,7 @@ import {
43
43
  ManageStudentsIconActive,
44
44
  } from "../assets/svg/students";
45
45
  import { ApiIcon, ApiIconActive } from "../assets/svg/apiIcon";
46
+ import CompuetrerIcon from "../components/header/assets/svg/computerIcon";
46
47
 
47
48
  export const user = {
48
49
  name: "John Doe",
@@ -81,6 +82,11 @@ export const leftNavMenu = [
81
82
  label: "Dictionary",
82
83
  icon: <DictionaryIcon />,
83
84
  },
85
+ {
86
+ path: "https://demo.learngual.com/type-select",
87
+ label: "Demo",
88
+ icon: <CompuetrerIcon />,
89
+ },
84
90
  ];
85
91
 
86
92
  export const sideMenuOptions = [
@@ -136,7 +142,7 @@ export const sideMenuOptions = [
136
142
  path: "/enterprise/manage-teams",
137
143
  icon: <TeamsIcon />,
138
144
  iconActive: <TeamsIconActive />,
139
- text: "Manage Teams",
145
+ text: "Manage teams",
140
146
  },
141
147
  {
142
148
  path: "/msg/enterprise/messages",
@@ -154,7 +160,7 @@ export const sideMenuOptions = [
154
160
  path: "/enterprise/file-manager",
155
161
  icon: <FileManagerIcon />,
156
162
  iconActive: <FileManagerIconActive />,
157
- text: "File Manager",
163
+ text: "File manager",
158
164
  },
159
165
  ],
160
166
  },
@@ -171,19 +177,19 @@ export const sideMenuOptions = [
171
177
  path: "/instructor/reports",
172
178
  icon: <AwardIcon />,
173
179
  iconActive: <AwardIconActive />,
174
- text: "Manage Report",
180
+ text: "Manage report",
175
181
  },
176
182
  {
177
183
  path: "/instructor/courses",
178
184
  icon: <CoursesIcon />,
179
185
  iconActive: <CoursesIconActive />,
180
- text: "Manage Courses",
186
+ text: "Manage courses",
181
187
  },
182
188
  {
183
189
  path: "/instructor/manage-students",
184
190
  icon: <ManageStudentsIcon />,
185
191
  iconActive: <ManageStudentsIconActive />,
186
- text: "Manage Student",
192
+ text: "Manage student",
187
193
  },
188
194
  {
189
195
  path: "/msg/instructor/messages",
@@ -208,7 +214,7 @@ export const sideMenuOptions = [
208
214
  path: "/instructor/file-manager",
209
215
  icon: <FileManagerIcon />,
210
216
  iconActive: <FileManagerIconActive />,
211
- text: "File Manager",
217
+ text: "File manager",
212
218
  },
213
219
  ],
214
220
  },
@@ -231,7 +237,7 @@ export const sideMenuOptions = [
231
237
  path: "/personal/courses",
232
238
  icon: <CoursesIcon />,
233
239
  iconActive: <CoursesIconActive />,
234
- text: "My Courses",
240
+ text: "My courses",
235
241
  },
236
242
  {
237
243
  path: "/personal/reports",