l-min-components 1.0.1135 → 1.0.1137

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.1135",
3
+ "version": "1.0.1137",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -218,8 +218,6 @@ const AppMainLayout = ({ children }) => {
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");
223
221
  return (
224
222
  <OutletContext.Provider
225
223
  value={{
@@ -275,7 +273,7 @@ const AppMainLayout = ({ children }) => {
275
273
  <MainLayout coming={coming}>
276
274
  <LeftLayout>
277
275
  <SideBar routes={leftNavMenu} findText={findText} />
278
- {!coming && !isDemo && (
276
+ {!coming && (
279
277
  <>
280
278
  {sideMenuLayout && (
281
279
  <SideMenu
@@ -328,7 +326,7 @@ const AppMainLayout = ({ children }) => {
328
326
  )}
329
327
  </CenterLayout>
330
328
 
331
- {rightLayout && !coming && !isDemo && (
329
+ {rightLayout && !coming && (
332
330
  <RightLayout>
333
331
  {rightComponent ??
334
332
  (window.location.pathname.includes("enterprise") &&
@@ -312,16 +312,17 @@ const HeaderComponent = (props) => {
312
312
  window.location.pathname.includes("developer");
313
313
 
314
314
  // Determine the label based on the current path
315
+ const hostname = window.location.hostname;
316
+
315
317
  const getNavLinkLabel = () => {
316
318
  const path = window.location.pathname;
317
- const hostname = window.location.hostname;
318
319
  if (path.includes("fun")) return "Fun";
319
320
  if (path.includes("community")) return "Community";
320
321
  if (path.includes("explore")) return "Explore";
321
322
  if (path.includes("connect")) return "Connect";
322
323
  if (path.includes("dictionary")) return "Dictionary";
323
324
  if (hostname.includes("demo")) return "Demo";
324
- return props.findText("Learning");
325
+ return "Learning";
325
326
  };
326
327
  const getNavLinkIcon = () => {
327
328
  const path = window.location.pathname;
@@ -444,9 +445,6 @@ const HeaderComponent = (props) => {
444
445
 
445
446
  const value = localStorage.getItem("defaultLang");
446
447
 
447
- // use this to check if we're on the demo app and remove most of the navbar items except the demo icon and text
448
- const isDemo = window.location.hostname.includes("demo");
449
-
450
448
  return (
451
449
  <Navbar>
452
450
  <img src={logo} alt="Learngual logo" />
@@ -462,65 +460,63 @@ const HeaderComponent = (props) => {
462
460
  </a>
463
461
  </li>
464
462
 
465
- {!isDemo && (
466
- <>
467
- <li>
468
- <a
469
- onClick={() => {
463
+ <>
464
+ <li>
465
+ <a
466
+ onClick={() => {
467
+ window.location.hostname.includes("coming")
468
+ ? (window.location.href =
469
+ "https://www.learngual.com/settings/account")
470
+ : (window.location.href = "/settings/account");
471
+ }}
472
+ className={
473
+ window.location.pathname.includes("settings") ? "active" : ""
474
+ }
475
+ style={{ cursor: "pointer" }}
476
+ >
477
+ <SettingIcon /> {props.findText("Settings")}
478
+ </a>
479
+ </li>
480
+ <li>
481
+ <a
482
+ // href={`https://559staging.learngual.com/${
483
+ // selectedAccount?.type
484
+ // ? selectedAccount?.type?.toLowerCase()
485
+ // : userAccountsDetail?.data?.[0]?.type?.toLowerCase()
486
+ // }/notifications/`}
487
+
488
+ onClick={(e) => {
489
+ if (isPendingDelete) {
490
+ e.preventDefault();
491
+ e.stopPropagation();
492
+ } else {
470
493
  window.location.hostname.includes("coming")
471
- ? (window.location.href =
472
- "https://www.learngual.com/settings/account")
473
- : (window.location.href = "/settings/account");
474
- }}
475
- className={
476
- window.location.pathname.includes("settings") ? "active" : ""
494
+ ? (window.location.href = `https://www.learngual.com/auth/sign-in`)
495
+ : (window.location.href = `/${
496
+ selectedAccount?.type
497
+ ? selectedAccount?.type?.toLowerCase()
498
+ : userAccountsDetail?.data?.[0]?.type?.toLowerCase()
499
+ }/notifications/`);
477
500
  }
478
- style={{ cursor: "pointer" }}
479
- >
480
- <SettingIcon /> {props.findText("Settings")}
481
- </a>
482
- </li>
483
- <li>
484
- <a
485
- // href={`https://559staging.learngual.com/${
486
- // selectedAccount?.type
487
- // ? selectedAccount?.type?.toLowerCase()
488
- // : userAccountsDetail?.data?.[0]?.type?.toLowerCase()
489
- // }/notifications/`}
490
-
491
- onClick={(e) => {
492
- if (isPendingDelete) {
493
- e.preventDefault();
494
- e.stopPropagation();
495
- } else {
496
- window.location.hostname.includes("coming")
497
- ? (window.location.href = `https://www.learngual.com/auth/sign-in`)
498
- : (window.location.href = `/${
499
- selectedAccount?.type
500
- ? selectedAccount?.type?.toLowerCase()
501
- : userAccountsDetail?.data?.[0]?.type?.toLowerCase()
502
- }/notifications/`);
503
- }
504
- }}
505
- className={
506
- window.location.pathname.includes("notifications")
507
- ? "active"
508
- : isPendingDelete
509
- ? "disabled"
510
- : ""
511
- }
512
- style={{ cursor: isPendingDelete ? "not-allowed" : "pointer" }}
513
- >
514
- {unreadNotificationData?.data?.count > 0 ? (
515
- <NotificationIcon />
516
- ) : (
517
- <NotificationEmptyIcon />
518
- )}
519
- {props.findText("Notifications")}
520
- </a>
521
- </li>
522
- </>
523
- )}
501
+ }}
502
+ className={
503
+ window.location.pathname.includes("notifications")
504
+ ? "active"
505
+ : isPendingDelete
506
+ ? "disabled"
507
+ : ""
508
+ }
509
+ style={{ cursor: isPendingDelete ? "not-allowed" : "pointer" }}
510
+ >
511
+ {unreadNotificationData?.data?.count > 0 ? (
512
+ <NotificationIcon />
513
+ ) : (
514
+ <NotificationEmptyIcon />
515
+ )}
516
+ {props.findText("Notifications")}
517
+ </a>
518
+ </li>
519
+ </>
524
520
  {/* <li style={{ marginLeft: "20%", cursor: "pointer" }}>
525
521
  <a
526
522
  onClick={() => {
@@ -541,14 +537,13 @@ const HeaderComponent = (props) => {
541
537
 
542
538
  </Help> */}
543
539
 
544
- {!isDemo && (
545
- <NavGroup
546
- onClick={() => {
547
- setLanguageDropdown();
548
- setIsOpen();
549
- }}
550
- >
551
- {/* {(!isDeveloper || !window.location.hostname.includes("coming")) && ( // when developer and on staging, don't show
540
+ <NavGroup
541
+ onClick={() => {
542
+ setLanguageDropdown();
543
+ setIsOpen();
544
+ }}
545
+ >
546
+ {/* {(!isDeveloper || !window.location.hostname.includes("coming")) && ( // when developer and on staging, don't show
552
547
  <SearchInputGroup>
553
548
  <SearchIcon />
554
549
  <SearchInput
@@ -570,96 +565,90 @@ const HeaderComponent = (props) => {
570
565
  </SearchInputGroup>
571
566
  )} */}
572
567
 
568
+ <div className="language_dropdown" onClick={(e) => e.stopPropagation()}>
573
569
  <div
574
- className="language_dropdown"
575
- onClick={(e) => e.stopPropagation()}
570
+ className="drop_holder"
571
+ onClick={() => {
572
+ setLanguageDropdown(!languageDropdown);
573
+ setIsOpen();
574
+ }}
576
575
  >
577
- <div
578
- className="drop_holder"
579
- onClick={() => {
580
- setLanguageDropdown(!languageDropdown);
581
- setIsOpen();
582
- }}
583
- >
584
- <img src={selectedLanguageData[value] || usFlag} alt="" />
585
- <ArrowDownIcon />
586
- </div>
587
- {languageDropdown && (
588
- <LanguageDropdown
589
- languageDropdown={languageDropdown}
590
- setLanguageDropdown={setLanguageDropdown}
591
- findText={props.findText}
592
- defaultLang={props.defaultLang}
593
- setDefaultLang={props.setDefaultLang}
594
- setIsTranslationsLoading={props.setIsTranslationsLoading}
595
- />
596
- )}
576
+ <img src={selectedLanguageData[value] || usFlag} alt="" />
577
+ <ArrowDownIcon />
597
578
  </div>
598
- {selectedAccount && (
599
- <UserProfile
600
- onClick={(e) => {
601
- e.stopPropagation();
602
- setIsOpen(!isOpen);
603
- setLanguageDropdown();
604
- }}
605
- ref={secondContainerRef}
606
- >
607
- <div className="user-img-container">
608
- <img
609
- src={selectedAccount?.profile_photo?.url || avatar}
610
- alt="profile"
611
- />
612
- </div>
613
- <div className="user-info-container">
614
- <h5 style={{ textTransform: "capitalize" }}>
615
- {selectedAccount?.metadata?.organization_name ||
616
- selectedAccount?.display_name}
617
- </h5>
618
- <h6 style={{ textTransform: "capitalize" }}>
619
- {selectedAccount?.type?.toLowerCase()}
620
- </h6>
621
- </div>
622
- <ArrowDownIcon width={16} height={10} />
623
- </UserProfile>
624
- )}
625
- </NavGroup>
626
- )}
627
-
628
- {!isDemo && (
629
- <>
630
- {isOpen && (
631
- <AccountDropdown
632
- avatar={avatar}
633
- activeAccountName={selectedAccount?.display_name}
634
- activeAccountType={"Personal Account"}
635
- accountName={"Default name"}
636
- accountType={"Default Account"}
637
- notificationCount={"5"}
638
- isOpen={isOpen}
639
- setIsOpen={setIsOpen}
640
- data={userAccountsDetail}
641
- selectedAccount={selectedAccount}
642
- setSelectedAccount={setSelectedAccount}
643
- developerAccountData={developerAccountData}
644
- setDeveloperAccountData={setDeveloperAccountData}
645
- personalAccountData={personalAccountData}
646
- setPersonalAccountData={setPersonalAccountData}
647
- instructorAccountData={instructorAccountData}
648
- setInstructorAccountData={setInstructorAccountData}
649
- enterpriseAccountData={enterpriseAccountData}
650
- setEnterpriseAccountData={setEnterpriseAccountData}
651
- setGeneralData={setGeneralData}
652
- userAccountsDetail={userAccountsDetail}
653
- userDetails={userDetails}
654
- setDefaultAccount={setDefaultAccount}
655
- handleSetDefaultAccount={handleSetDefaultAccount}
656
- ref={acctDropdownContainerRef}
657
- hasDeveloperAccount={hasDeveloperAccount}
579
+ {languageDropdown && (
580
+ <LanguageDropdown
581
+ languageDropdown={languageDropdown}
582
+ setLanguageDropdown={setLanguageDropdown}
658
583
  findText={props.findText}
584
+ defaultLang={props.defaultLang}
585
+ setDefaultLang={props.setDefaultLang}
586
+ setIsTranslationsLoading={props.setIsTranslationsLoading}
659
587
  />
660
588
  )}
661
- </>
662
- )}
589
+ </div>
590
+ {selectedAccount && (
591
+ <UserProfile
592
+ onClick={(e) => {
593
+ e.stopPropagation();
594
+ setIsOpen(!isOpen);
595
+ setLanguageDropdown();
596
+ }}
597
+ ref={secondContainerRef}
598
+ >
599
+ <div className="user-img-container">
600
+ <img
601
+ src={selectedAccount?.profile_photo?.url || avatar}
602
+ alt="profile"
603
+ />
604
+ </div>
605
+ <div className="user-info-container">
606
+ <h5 style={{ textTransform: "capitalize" }}>
607
+ {selectedAccount?.metadata?.organization_name ||
608
+ selectedAccount?.display_name}
609
+ </h5>
610
+ <h6 style={{ textTransform: "capitalize" }}>
611
+ {selectedAccount?.type?.toLowerCase()}
612
+ </h6>
613
+ </div>
614
+ <ArrowDownIcon width={16} height={10} />
615
+ </UserProfile>
616
+ )}
617
+ </NavGroup>
618
+
619
+ <>
620
+ {isOpen && (
621
+ <AccountDropdown
622
+ avatar={avatar}
623
+ activeAccountName={selectedAccount?.display_name}
624
+ activeAccountType={"Personal Account"}
625
+ accountName={"Default name"}
626
+ accountType={"Default Account"}
627
+ notificationCount={"5"}
628
+ isOpen={isOpen}
629
+ setIsOpen={setIsOpen}
630
+ data={userAccountsDetail}
631
+ selectedAccount={selectedAccount}
632
+ setSelectedAccount={setSelectedAccount}
633
+ developerAccountData={developerAccountData}
634
+ setDeveloperAccountData={setDeveloperAccountData}
635
+ personalAccountData={personalAccountData}
636
+ setPersonalAccountData={setPersonalAccountData}
637
+ instructorAccountData={instructorAccountData}
638
+ setInstructorAccountData={setInstructorAccountData}
639
+ enterpriseAccountData={enterpriseAccountData}
640
+ setEnterpriseAccountData={setEnterpriseAccountData}
641
+ setGeneralData={setGeneralData}
642
+ userAccountsDetail={userAccountsDetail}
643
+ userDetails={userDetails}
644
+ setDefaultAccount={setDefaultAccount}
645
+ handleSetDefaultAccount={handleSetDefaultAccount}
646
+ ref={acctDropdownContainerRef}
647
+ hasDeveloperAccount={hasDeveloperAccount}
648
+ findText={props.findText}
649
+ />
650
+ )}
651
+ </>
663
652
  </Navbar>
664
653
  );
665
654
  };