l-min-components 1.0.964 → 1.0.976
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
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
SearchInputGroup,
|
|
18
18
|
SearchInput,
|
|
19
19
|
UserProfile,
|
|
20
|
-
Help
|
|
20
|
+
Help,
|
|
21
21
|
} from "./index.styled";
|
|
22
22
|
import useHeader from "./getHeaderDetails";
|
|
23
23
|
import { FullPageLoader, OutletContext } from "..";
|
|
@@ -62,14 +62,11 @@ const HeaderComponent = (props) => {
|
|
|
62
62
|
retrieveUserDetailsData,
|
|
63
63
|
handleRetrieveUserDetails,
|
|
64
64
|
updateUserAccountData,
|
|
65
|
-
handleUpdateUserAccount
|
|
65
|
+
handleUpdateUserAccount,
|
|
66
66
|
} = useHeader();
|
|
67
67
|
const { pathname } = useLocation();
|
|
68
|
-
const {
|
|
69
|
-
|
|
70
|
-
generalData,
|
|
71
|
-
notificationMarkReadData,
|
|
72
|
-
} = useContext(OutletContext);
|
|
68
|
+
const { setGeneralData, generalData, notificationMarkReadData } =
|
|
69
|
+
useContext(OutletContext);
|
|
73
70
|
const [selectedAccount, setSelectedAccount] = useState();
|
|
74
71
|
const { setDefaultAccount, handleSetDefaultAccount } = useHeader();
|
|
75
72
|
|
|
@@ -81,7 +78,6 @@ const HeaderComponent = (props) => {
|
|
|
81
78
|
handleGetUnreadNotification();
|
|
82
79
|
}, []);
|
|
83
80
|
|
|
84
|
-
|
|
85
81
|
// Merge the notification_count into the results data using find
|
|
86
82
|
|
|
87
83
|
const allUserAccountsDetail = userAccountsDetail?.data?.results.map(
|
|
@@ -263,6 +259,11 @@ const HeaderComponent = (props) => {
|
|
|
263
259
|
: ".learngual.com"
|
|
264
260
|
}; path=/; expires=${date.toUTCString()};`;
|
|
265
261
|
|
|
262
|
+
localStorage.setItem(
|
|
263
|
+
"defaultLang",
|
|
264
|
+
JSON?.stringify(getDefaultAccount?.data?.language)
|
|
265
|
+
);
|
|
266
|
+
|
|
266
267
|
setSelectedAccount(getDefaultAccount?.data);
|
|
267
268
|
}
|
|
268
269
|
}, [getDefaultAccount?.data]);
|
|
@@ -373,7 +374,7 @@ const HeaderComponent = (props) => {
|
|
|
373
374
|
websocket2.addEventListener("message", handler, { passive: true });
|
|
374
375
|
|
|
375
376
|
return () => {
|
|
376
|
-
|
|
377
|
+
websocket2.removeEventListener("message", handler);
|
|
377
378
|
//console.log("room websocket closed");
|
|
378
379
|
};
|
|
379
380
|
}, []);
|
|
@@ -391,25 +392,24 @@ const HeaderComponent = (props) => {
|
|
|
391
392
|
const isPendingDelete =
|
|
392
393
|
generalData?.selectedAccount?.pending_delete === true &&
|
|
393
394
|
window.location.hostname.includes("staging");
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
const [currentFlag, setCurrentFlag] = useState(usFlag)
|
|
395
|
+
|
|
396
|
+
const [currentFlag, setCurrentFlag] = useState(usFlag);
|
|
397
397
|
const value = JSON?.parse(localStorage?.getItem("defaultLang"));
|
|
398
398
|
const currentFlagIcon = value?.flag;
|
|
399
|
-
const selectedLanguage = languagesData?.find(
|
|
400
|
-
|
|
399
|
+
const selectedLanguage = languagesData?.find(
|
|
400
|
+
(lang) => lang?.slug === props?.defaultLang
|
|
401
|
+
);
|
|
402
|
+
|
|
401
403
|
useEffect(() => {
|
|
402
|
-
if(currentFlagIcon) {
|
|
403
|
-
setCurrentFlag(currentFlagIcon)
|
|
404
|
+
if (currentFlagIcon) {
|
|
405
|
+
setCurrentFlag(currentFlagIcon);
|
|
404
406
|
} else {
|
|
405
|
-
setCurrentFlag(usFlag)
|
|
407
|
+
setCurrentFlag(usFlag);
|
|
406
408
|
}
|
|
407
|
-
}, [])
|
|
408
|
-
|
|
409
|
+
}, []);
|
|
409
410
|
|
|
410
411
|
return (
|
|
411
412
|
<Navbar>
|
|
412
|
-
|
|
413
413
|
<img src={logo} alt="Learngual logo" />
|
|
414
414
|
<Nav
|
|
415
415
|
onClick={() => {
|
|
@@ -483,20 +483,21 @@ const HeaderComponent = (props) => {
|
|
|
483
483
|
{props.findText("Notifications")}
|
|
484
484
|
</a>
|
|
485
485
|
</li>
|
|
486
|
-
<li style={{marginLeft: "20%", cursor: "pointer"}}>
|
|
487
|
-
<a
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
486
|
+
<li style={{ marginLeft: "20%", cursor: "pointer" }}>
|
|
487
|
+
<a
|
|
488
|
+
onClick={() => {
|
|
489
|
+
window.location.href =
|
|
490
|
+
"https://559staging.learngual.com/help-center";
|
|
491
|
+
}}
|
|
492
|
+
className={
|
|
493
493
|
window.location.pathname.includes("help-center") ? "active" : ""
|
|
494
|
-
}
|
|
495
|
-
|
|
494
|
+
}
|
|
495
|
+
>
|
|
496
|
+
<QuestionMark /> {props?.findText("Help")}
|
|
496
497
|
</a>
|
|
497
498
|
</li>
|
|
498
499
|
</Nav>
|
|
499
|
-
{/*
|
|
500
|
+
{/*
|
|
500
501
|
<Help>
|
|
501
502
|
<QuestionMark />
|
|
502
503
|
Help
|
|
@@ -539,7 +540,7 @@ const HeaderComponent = (props) => {
|
|
|
539
540
|
setIsOpen();
|
|
540
541
|
}}
|
|
541
542
|
>
|
|
542
|
-
<img src={
|
|
543
|
+
<img src={currentFlag || usFlag} alt="" />
|
|
543
544
|
<ArrowDownIcon />
|
|
544
545
|
</div>
|
|
545
546
|
{languageDropdown && (
|
|
@@ -214,8 +214,8 @@ export const Nav = styled.ul`
|
|
|
214
214
|
& svg path {
|
|
215
215
|
stroke: ${({ isActive }) =>
|
|
216
216
|
isActive ? "rgba(0, 194, 194, 1)" : "currentcolor"};
|
|
217
|
-
fill: ${({ isActive }) =>
|
|
218
|
-
isActive ? "rgba(0, 194, 194, 1)" : "currentcolor"};
|
|
217
|
+
/* fill: ${({ isActive }) =>
|
|
218
|
+
isActive ? "rgba(0, 194, 194, 1)" : "currentcolor"}; */
|
|
219
219
|
|
|
220
220
|
}
|
|
221
221
|
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
useState,
|
|
3
|
-
useEffect,
|
|
4
|
-
useRef,
|
|
5
|
-
useCallback,
|
|
6
|
-
} from "react";
|
|
1
|
+
import React, { useState, useEffect, useRef, useCallback } from "react";
|
|
7
2
|
import logo from "./assets/images/logo.png";
|
|
8
|
-
import { Navbar2, NavGroup2
|
|
3
|
+
import { Navbar2, NavGroup2 } from "./index.styled";
|
|
9
4
|
import { ArrowDownIcon } from "./assets/svg/arrow-down";
|
|
10
5
|
import ButtonComponent from "../button";
|
|
11
6
|
import { useLocation, useNavigate } from "react-router-dom";
|
|
@@ -23,7 +18,6 @@ import { FullPageLoader } from "..";
|
|
|
23
18
|
*
|
|
24
19
|
*/
|
|
25
20
|
const HeaderComponentTwo = (props) => {
|
|
26
|
-
|
|
27
21
|
const [selected, setSelected] = useState("ES");
|
|
28
22
|
const [isOpen, setIsOpen] = useState(false);
|
|
29
23
|
const [searchResultOpen, setSearchResultOpen] = useState(false);
|
|
@@ -83,8 +77,8 @@ const HeaderComponentTwo = (props) => {
|
|
|
83
77
|
setLanguageDropdown();
|
|
84
78
|
props.setDefaultLang(item?.slug);
|
|
85
79
|
item?.slug === props.defaultLang
|
|
86
|
-
? props
|
|
87
|
-
: props
|
|
80
|
+
? props?.setIsTranslationsLoading(false)
|
|
81
|
+
: props?.setIsTranslationsLoading(true);
|
|
88
82
|
localStorage.setItem("defaultLang", JSON?.stringify(item));
|
|
89
83
|
window.location.reload();
|
|
90
84
|
};
|
|
@@ -125,10 +119,7 @@ const HeaderComponentTwo = (props) => {
|
|
|
125
119
|
{languageDropdown && (
|
|
126
120
|
<ul className="dropdown_list" ref={containerRef}>
|
|
127
121
|
{languagesData?.map((item, idx) => (
|
|
128
|
-
<li
|
|
129
|
-
key={idx}
|
|
130
|
-
onClick={() => handleLanguageChange(item)}
|
|
131
|
-
>
|
|
122
|
+
<li key={idx} onClick={() => handleLanguageChange(item)}>
|
|
132
123
|
<img src={item?.flag} alt="" /> <span>{item?.name}</span>
|
|
133
124
|
</li>
|
|
134
125
|
))}
|
|
@@ -49,7 +49,7 @@ const SideMenu = ({
|
|
|
49
49
|
generalData?.selectedAccount?.type === "PERSONAL" &&
|
|
50
50
|
window.location.hostname.includes("staging");
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
// When pending delete and on staging
|
|
53
53
|
const isPendingDelete =
|
|
54
54
|
generalData?.selectedAccount?.pending_delete === true &&
|
|
55
55
|
window.location.hostname.includes("staging");
|
|
@@ -346,7 +346,7 @@ const SideMenu = ({
|
|
|
346
346
|
<IconContainer>{/* <CiLogout /> */}</IconContainer>
|
|
347
347
|
{/* <TextContainer minimal={isOpen}>Log out</TextContainer> */}
|
|
348
348
|
</LogoutButtonContainer>
|
|
349
|
-
<div className="toggle" onClick={onToggle}>
|
|
349
|
+
<div className="toggle" onClick={onToggle} style={{ cursor: "pointer" }}>
|
|
350
350
|
{isOpen ? <IoIosArrowBack /> : <IoIosArrowForward />}
|
|
351
351
|
</div>
|
|
352
352
|
</SideMenuContainer>
|