l-min-components 1.0.788 → 1.0.794
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
|
@@ -61,8 +61,13 @@ const HeaderComponent = (props) => {
|
|
|
61
61
|
handleGetNotification,
|
|
62
62
|
} = useHeader();
|
|
63
63
|
const { pathname } = useLocation();
|
|
64
|
-
const {
|
|
65
|
-
|
|
64
|
+
const {
|
|
65
|
+
setGeneralData,
|
|
66
|
+
generalData,
|
|
67
|
+
notificationMarkReadData,
|
|
68
|
+
findText,
|
|
69
|
+
defaultLang,
|
|
70
|
+
} = useContext(OutletContext);
|
|
66
71
|
const [selectedAccount, setSelectedAccount] = useState();
|
|
67
72
|
const { setDefaultAccount, handleSetDefaultAccount } = useHeader();
|
|
68
73
|
|
|
@@ -365,7 +370,13 @@ const HeaderComponent = (props) => {
|
|
|
365
370
|
}, [notificationMarkReadData?.response]);
|
|
366
371
|
const value = JSON?.parse(localStorage.getItem("defaultLang"));
|
|
367
372
|
const currentFlag = value?.flag;
|
|
368
|
-
console.log("defaultLang", defaultLang)
|
|
373
|
+
console.log("defaultLang", defaultLang);
|
|
374
|
+
|
|
375
|
+
// When Developer and on staging
|
|
376
|
+
const isDeveloper =
|
|
377
|
+
generalData?.selectedAccount?.type === "DEVELOPER" &&
|
|
378
|
+
window.location.hostname.includes("staging");
|
|
379
|
+
|
|
369
380
|
return (
|
|
370
381
|
<Navbar>
|
|
371
382
|
<img src={logo} alt="Learngual logo" />
|
|
@@ -373,7 +384,8 @@ console.log("defaultLang", defaultLang)
|
|
|
373
384
|
onClick={() => {
|
|
374
385
|
setLanguageDropdown();
|
|
375
386
|
setIsOpen();
|
|
376
|
-
}}
|
|
387
|
+
}}
|
|
388
|
+
>
|
|
377
389
|
<li>
|
|
378
390
|
<a className={isHomePage() ? "active" : ""}>
|
|
379
391
|
<BookIcon /> {getNavLinkLabel()}
|
|
@@ -398,7 +410,8 @@ console.log("defaultLang", defaultLang)
|
|
|
398
410
|
className={
|
|
399
411
|
window.location.pathname.includes("settings") ? "active" : ""
|
|
400
412
|
}
|
|
401
|
-
style={{ cursor: "pointer" }}
|
|
413
|
+
style={{ cursor: "pointer" }}
|
|
414
|
+
>
|
|
402
415
|
<SettingIcon /> {findText("Settings")}
|
|
403
416
|
</a>
|
|
404
417
|
</li>
|
|
@@ -412,7 +425,8 @@ console.log("defaultLang", defaultLang)
|
|
|
412
425
|
className={
|
|
413
426
|
window.location.pathname.includes("notifications") ? "active" : ""
|
|
414
427
|
}
|
|
415
|
-
style={{ cursor: "pointer" }}
|
|
428
|
+
style={{ cursor: "pointer" }}
|
|
429
|
+
>
|
|
416
430
|
{unreadNotificationData?.data?.count > 0 ? (
|
|
417
431
|
<NotificationIcon />
|
|
418
432
|
) : (
|
|
@@ -427,28 +441,29 @@ console.log("defaultLang", defaultLang)
|
|
|
427
441
|
onClick={() => {
|
|
428
442
|
setLanguageDropdown();
|
|
429
443
|
setIsOpen();
|
|
430
|
-
}}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
<
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
444
|
+
}}
|
|
445
|
+
>
|
|
446
|
+
{!isDeveloper && ( // when developer and on staging, don't show
|
|
447
|
+
<SearchInputGroup>
|
|
448
|
+
<SearchIcon />
|
|
449
|
+
<SearchInput
|
|
450
|
+
type={props.inputType}
|
|
451
|
+
value={props.value}
|
|
452
|
+
id={props.inputId}
|
|
453
|
+
placeholder={props.placeholder}
|
|
454
|
+
style={props.inputStyles}
|
|
455
|
+
onChange={props.onChange}
|
|
456
|
+
onFocus={() => setSearchResultOpen(true)}
|
|
457
|
+
onBlur={() => setSearchResultOpen(false)}
|
|
458
|
+
/>
|
|
459
|
+
|
|
460
|
+
{searchResultOpen && (
|
|
461
|
+
<div className="search-result-wrapper">
|
|
462
|
+
<p>{/* Website <span>UIUX </span> Design */}</p>
|
|
463
|
+
</div>
|
|
464
|
+
)}
|
|
465
|
+
</SearchInputGroup>
|
|
466
|
+
)}
|
|
452
467
|
|
|
453
468
|
<div className="language_dropdown" onClick={(e) => e.stopPropagation()}>
|
|
454
469
|
<div
|
|
@@ -456,7 +471,8 @@ console.log("defaultLang", defaultLang)
|
|
|
456
471
|
onClick={() => {
|
|
457
472
|
setLanguageDropdown(!languageDropdown);
|
|
458
473
|
setIsOpen();
|
|
459
|
-
}}
|
|
474
|
+
}}
|
|
475
|
+
>
|
|
460
476
|
<img src={currentFlag || usFlag} alt="" />
|
|
461
477
|
<ArrowDownIcon />
|
|
462
478
|
</div>
|
|
@@ -474,7 +490,8 @@ console.log("defaultLang", defaultLang)
|
|
|
474
490
|
setIsOpen(!isOpen);
|
|
475
491
|
setLanguageDropdown();
|
|
476
492
|
}}
|
|
477
|
-
ref={secondContainerRef}
|
|
493
|
+
ref={secondContainerRef}
|
|
494
|
+
>
|
|
478
495
|
<div className="user-img-container">
|
|
479
496
|
<img
|
|
480
497
|
src={selectedAccount?.profile_photo?.url || avatar}
|
|
@@ -44,8 +44,11 @@ const SideMenu = ({
|
|
|
44
44
|
// Normal route filter
|
|
45
45
|
const [filteredRoutes, setFilteredRoutes] = useState();
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
// When personal and on staging
|
|
48
|
+
const isPersonal =
|
|
49
|
+
generalData?.selectedAccount?.type === "PERSONAL" &&
|
|
50
|
+
window.location.hostname.includes("staging");
|
|
51
|
+
|
|
49
52
|
useEffect(() => {
|
|
50
53
|
if (userType) {
|
|
51
54
|
setFilteredRoutes(
|
|
@@ -303,14 +306,10 @@ const SideMenu = ({
|
|
|
303
306
|
)}
|
|
304
307
|
minimal={isOpen}
|
|
305
308
|
>
|
|
306
|
-
{
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
</IconContainer>
|
|
311
|
-
<TextContainer minimal={isOpen}>{text}</TextContainer>
|
|
312
|
-
</>
|
|
313
|
-
)}
|
|
309
|
+
<IconContainer active={active}>
|
|
310
|
+
{active ? iconActive : icon}
|
|
311
|
+
</IconContainer>
|
|
312
|
+
<TextContainer minimal={isOpen}>{text}</TextContainer>
|
|
314
313
|
|
|
315
314
|
{notifications && (
|
|
316
315
|
<NotificationCount minimal={isOpen}>
|
|
@@ -328,10 +327,13 @@ const SideMenu = ({
|
|
|
328
327
|
>
|
|
329
328
|
<UserCard user={user} isOpen={isOpen} />
|
|
330
329
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
330
|
+
{!isPersonal && (
|
|
331
|
+
<>
|
|
332
|
+
<NavigationContainer>
|
|
333
|
+
{routeFilter && routeFilter?.map(renderNavigationItem)}
|
|
334
|
+
</NavigationContainer>
|
|
335
|
+
</>
|
|
336
|
+
)}
|
|
335
337
|
<LogoutButtonContainer onClick={onLogout}>
|
|
336
338
|
<IconContainer>{/* <CiLogout /> */}</IconContainer>
|
|
337
339
|
{/* <TextContainer minimal={isOpen}>Log out</TextContainer> */}
|