l-min-components 1.0.828 → 1.0.833
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 +2 -1
- package/src/components/ImageComponent/index.jsx +103 -0
- package/src/components/ImageComponent/index.styled.jsx +29 -0
- package/src/components/header/getHeaderDetails.js +28 -0
- package/src/components/header/index.jsx +16 -1
- package/src/components/header/languageDropdown.jsx +17 -2
- package/src/components/header/languages.js +15 -0
- package/src/components/index.js +53 -52
- package/src/hooks/useTranslation.jsx +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "l-min-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.833",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"src/assets",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"react-flags-select": "^2.2.3",
|
|
44
44
|
"react-google-charts": "^4.0.1",
|
|
45
45
|
"react-icons": "^4.8.0",
|
|
46
|
+
"react-image": "^4.1.0",
|
|
46
47
|
"react-input-emoji": "^5.3.1",
|
|
47
48
|
"react-lottie": "^1.2.4",
|
|
48
49
|
"react-mic": "^12.4.6",
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Img } from "react-image";
|
|
3
|
+
import { ImageFallbackContainer } from "./index.styled";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} props
|
|
7
|
+
* @param {"extra-small"| "small"| "medium" | "big"} props.fallbackLogoSize
|
|
8
|
+
* @param {string} props.src
|
|
9
|
+
* @param {string} props.alt
|
|
10
|
+
* @param {string} props.width - please use this for sizing and add "px" at the end of the value
|
|
11
|
+
* @param {string} props.height - please use this for sizing and add "px" at the end of the value
|
|
12
|
+
* @returns {JSX.Element}
|
|
13
|
+
*/
|
|
14
|
+
const ImageComponents = ({
|
|
15
|
+
src,
|
|
16
|
+
fallbackLogoSize = "medium",
|
|
17
|
+
width = "200px",
|
|
18
|
+
height = "200px",
|
|
19
|
+
alt,
|
|
20
|
+
className,
|
|
21
|
+
}) => {
|
|
22
|
+
return (
|
|
23
|
+
<Img
|
|
24
|
+
className={className}
|
|
25
|
+
src="https://images.pexels.com/photos/460672/pexels-photo-460672.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2"
|
|
26
|
+
width={width}
|
|
27
|
+
height={height}
|
|
28
|
+
alt={alt}
|
|
29
|
+
loader={
|
|
30
|
+
<FallbackImage size={fallbackLogoSize} width={width} height={height} />
|
|
31
|
+
}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const FallbackImage = ({ size, width, height }) => {
|
|
37
|
+
return (
|
|
38
|
+
<ImageFallbackContainer $size={size} $width={width} $height={height}>
|
|
39
|
+
<Logo />
|
|
40
|
+
</ImageFallbackContainer>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const Logo = () => (
|
|
45
|
+
<svg
|
|
46
|
+
width="31"
|
|
47
|
+
height="21"
|
|
48
|
+
viewBox="0 0 31 21"
|
|
49
|
+
fill="none"
|
|
50
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
+
>
|
|
52
|
+
<g clipPath="url(#clip0_37964_330186)">
|
|
53
|
+
<path
|
|
54
|
+
d="M0 0.472656H2.02205V8.20059H6.67623V9.87664H0V0.472656Z"
|
|
55
|
+
fill="#C6CCCC"
|
|
56
|
+
/>
|
|
57
|
+
<path
|
|
58
|
+
d="M8.78635 6.75914C8.78635 7.64253 9.22744 8.50434 10.1956 8.50434C11.0063 8.50434 11.2371 8.17648 11.4212 7.75013H13.3663C13.1137 8.6143 12.3504 10.0316 10.1449 10.0316C7.83193 10.0316 6.82812 8.29353 6.82812 6.44073C6.8288 4.226 7.95757 2.64844 10.2148 2.64844C12.6373 2.65316 13.4479 4.40241 13.4479 6.16515C13.4532 6.36341 13.4444 6.56179 13.4217 6.7588L8.78635 6.75914ZM11.4998 5.56205C11.4853 4.74106 11.1588 4.05128 10.2121 4.05128C9.26541 4.05128 8.90527 4.69215 8.82196 5.55969L11.4998 5.56205Z"
|
|
59
|
+
fill="#C6CCCC"
|
|
60
|
+
/>
|
|
61
|
+
<path
|
|
62
|
+
d="M16.1261 10.0505C14.4336 10.0505 13.5938 8.91311 13.5938 7.81924C13.5938 6.21267 14.8767 5.47061 16.932 5.47061H17.9335V5.03953C17.9335 4.53932 17.7548 4.04584 16.8534 4.04584C16.0307 4.04584 15.852 4.39529 15.7636 4.90765H13.9203C14.0251 3.65322 14.7978 2.64064 16.9317 2.65245C18.813 2.66425 19.8359 3.40193 19.8359 5.08102V8.00577C19.8383 8.03203 19.8383 8.05844 19.8359 8.0847C19.414 10.3689 16.1261 10.0505 16.1261 10.0505ZM17.9429 6.66061H17.1514C15.9783 6.66061 15.5442 7.01984 15.5442 7.6995C15.5383 7.83099 15.561 7.96221 15.6108 8.08397C15.6606 8.20573 15.7363 8.31511 15.8326 8.40447C15.9288 8.49383 16.0433 8.56101 16.1681 8.60133C16.2929 8.64164 16.425 8.65411 16.5551 8.63788C17.7904 8.63788 17.9429 7.77607 17.9429 6.84478V6.66061Z"
|
|
63
|
+
fill="#C6CCCC"
|
|
64
|
+
/>
|
|
65
|
+
<path
|
|
66
|
+
d="M16.1238 17.8005C14.4309 17.8005 13.5938 16.6635 13.5938 15.5716C13.5938 13.965 14.8767 13.223 16.932 13.223H17.9335V12.7919C17.9335 12.2917 17.7548 11.7982 16.8534 11.7982C16.0307 11.7982 15.852 12.1476 15.7636 12.6576H13.9179C14.0228 11.4056 14.7954 10.3906 16.9317 10.4024C18.813 10.4143 19.8359 11.1519 19.8359 12.831V15.7564C19.8383 15.7827 19.8383 15.8091 19.8359 15.8354C19.4116 18.1213 16.1238 17.8005 16.1238 17.8005ZM17.9405 14.4082H17.1491C15.9759 14.4082 15.5419 14.7675 15.5419 15.4471C15.5359 15.5787 15.5586 15.7101 15.6083 15.832C15.658 15.9539 15.7337 16.0635 15.8299 16.153C15.9261 16.2426 16.0407 16.31 16.1655 16.3506C16.2904 16.3911 16.4225 16.4039 16.5528 16.3879C17.788 16.3879 17.9405 15.5261 17.9405 14.5948V14.4082Z"
|
|
67
|
+
fill="#C6CCCC"
|
|
68
|
+
/>
|
|
69
|
+
<path
|
|
70
|
+
d="M24.6914 4.59116C24.6914 3.99278 24.6914 3.33437 24.6797 2.81492H26.5643C26.605 3.11267 26.6297 3.41241 26.6382 3.71282C26.8768 3.26994 27.4465 2.65234 28.6768 2.65234C30.0861 2.65234 31.0039 3.60994 31.0039 5.38146V9.86758H29.0581V5.59666C29.0581 4.80433 28.7957 4.22957 27.9373 4.22957C27.079 4.22957 26.6379 4.69167 26.6379 5.93666V9.86758H24.6921L24.6914 4.59116Z"
|
|
71
|
+
fill="#C6CCCC"
|
|
72
|
+
/>
|
|
73
|
+
<path
|
|
74
|
+
d="M6.79079 16.778C6.79079 19.0426 5.95866 20.4745 3.29696 20.4745C0.731352 20.4745 0.237849 19.0356 0.159238 18.2409H2.14602C2.28443 18.7198 2.63952 19.0548 3.38901 19.0548C4.65284 19.0548 4.88867 18.2814 4.88867 16.9001V16.5628C4.52384 17.1733 3.93492 17.5538 2.90962 17.5538C1.05386 17.5538 0 16.0359 0 14.1349C0 11.9303 1.31388 10.4219 3.07121 10.4219C4.26348 10.4219 4.77848 10.9916 4.8833 11.3221C4.89774 11.1305 4.9478 10.7022 4.95956 10.5848H6.80524C6.79348 11.2145 6.79079 11.9303 6.79079 12.6086V16.778ZM1.9982 14.0479C1.9982 15.2622 2.6029 15.9776 3.46225 15.9776C4.63302 15.9776 4.94545 15.1708 4.94545 13.9858C4.94545 12.8009 4.73817 11.9843 3.51466 11.9843C2.65867 11.9853 1.9982 12.6386 1.9982 14.0479Z"
|
|
75
|
+
fill="#C6CCCC"
|
|
76
|
+
/>
|
|
77
|
+
<path
|
|
78
|
+
d="M13.2359 15.5856C13.2359 16.2656 13.2359 17.0053 13.2477 17.635H11.3402C11.314 17.4458 11.2995 17.0677 11.2878 16.8211C10.8705 17.5392 10.2507 17.7993 9.35405 17.7993C7.92326 17.7993 7.00781 16.9277 7.00781 15.166V10.582H8.95125V14.7858C8.95125 15.564 9.18978 16.2079 10.0337 16.2079C10.9206 16.2079 11.2878 15.7289 11.2878 14.3359V10.582H13.2335L13.2359 15.5856Z"
|
|
79
|
+
fill="#C6CCCC"
|
|
80
|
+
/>
|
|
81
|
+
<path
|
|
82
|
+
d="M22.0615 4.06497C22.0615 3.68415 22.0353 2.9856 22.0091 2.8274H20.1016C20.1016 3.41633 20.116 4.03866 20.116 4.74261V6.67231H20.1016V15.7734C20.1016 17.0677 20.7803 17.7149 22.1377 17.7149C22.4839 17.7214 22.8292 17.6779 23.163 17.5857V15.9488H23.0915C22.8471 15.9789 22.601 15.9933 22.3547 15.992C22.1532 15.992 22.0524 15.8506 22.0524 15.5707V9.86791V6.79172C22.0524 4.85965 22.8939 4.47917 24.3056 4.51493V2.65234C23.1274 2.65707 22.3715 3.246 22.0615 4.06497Z"
|
|
83
|
+
fill="#C6CCCC"
|
|
84
|
+
/>
|
|
85
|
+
<path
|
|
86
|
+
d="M26.5346 18.0197C27.6842 18.0197 28.6162 17.084 28.6162 15.9298C28.6162 14.7755 27.6842 13.8398 26.5346 13.8398C25.3851 13.8398 24.4531 14.7755 24.4531 15.9298C24.4531 17.084 25.3851 18.0197 26.5346 18.0197Z"
|
|
87
|
+
fill="#C6CCCC"
|
|
88
|
+
/>
|
|
89
|
+
</g>
|
|
90
|
+
<defs>
|
|
91
|
+
<clipPath id="clip0_37964_330186">
|
|
92
|
+
<rect
|
|
93
|
+
width="31"
|
|
94
|
+
height="20"
|
|
95
|
+
fill="white"
|
|
96
|
+
transform="translate(0 0.472656)"
|
|
97
|
+
/>
|
|
98
|
+
</clipPath>
|
|
99
|
+
</defs>
|
|
100
|
+
</svg>
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
export default ImageComponents;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const ImageFallbackContainer = styled.div`
|
|
4
|
+
background: #dfe5e5;
|
|
5
|
+
place-items: center;
|
|
6
|
+
display: grid;
|
|
7
|
+
width: ${({ $width }) => $width};
|
|
8
|
+
height: ${({ $height }) => $height};
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
|
|
11
|
+
svg {
|
|
12
|
+
width: ${({ $size }) =>
|
|
13
|
+
$size === "extra-small"
|
|
14
|
+
? "24px"
|
|
15
|
+
: $size === "small"
|
|
16
|
+
? "32px"
|
|
17
|
+
: $size === "big"
|
|
18
|
+
? "96px"
|
|
19
|
+
: "64px"};
|
|
20
|
+
height: ${({ $size }) =>
|
|
21
|
+
$size === "extra-small"
|
|
22
|
+
? "24px"
|
|
23
|
+
: $size === "small"
|
|
24
|
+
? "32px"
|
|
25
|
+
: $size === "big"
|
|
26
|
+
? "96px"
|
|
27
|
+
: "64px"};
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
@@ -11,6 +11,30 @@ const useHeader = () => {
|
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
+
const [{ ...retrieveUserDetailsData }, retrieveUserDetails] = useAxios();
|
|
15
|
+
|
|
16
|
+
const handleRetrieveUserDetails = async (data) => {
|
|
17
|
+
await retrieveUserDetails({
|
|
18
|
+
method: "patch",
|
|
19
|
+
url: "/iam/v1/users/me/",
|
|
20
|
+
data: {
|
|
21
|
+
...data,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const [{ ...updateUserAccountData }, updateUserAccount] = useAxios();
|
|
27
|
+
|
|
28
|
+
const handleUpdateUserAccount = async (id, data) => {
|
|
29
|
+
await updateUserAccount({
|
|
30
|
+
method: "patch",
|
|
31
|
+
url: `/iam/v1/accounts/${id}/`,
|
|
32
|
+
data: {
|
|
33
|
+
...data,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
14
38
|
// get user accounts detail
|
|
15
39
|
|
|
16
40
|
const [{ ...userAccountsDetail }, getUserAccountsDetail] = useAxios();
|
|
@@ -216,6 +240,10 @@ const useHeader = () => {
|
|
|
216
240
|
handleGetUserPlan,
|
|
217
241
|
getCurrentSubscriptionData,
|
|
218
242
|
handleCurrentSubscription,
|
|
243
|
+
retrieveUserDetailsData,
|
|
244
|
+
handleRetrieveUserDetails,
|
|
245
|
+
updateUserAccountData,
|
|
246
|
+
handleUpdateUserAccount
|
|
219
247
|
};
|
|
220
248
|
};
|
|
221
249
|
export default useHeader;
|
|
@@ -29,6 +29,7 @@ import usFlag from "../../assets/images/usFlag.png";
|
|
|
29
29
|
import LanguageDropdown from "./languageDropdown";
|
|
30
30
|
import { getCookie } from "./getCookies";
|
|
31
31
|
import { data } from "../GraphMap/data";
|
|
32
|
+
import { languagesData } from "./languages";
|
|
32
33
|
/**
|
|
33
34
|
* @param {{
|
|
34
35
|
* type: string,
|
|
@@ -59,6 +60,10 @@ const HeaderComponent = (props) => {
|
|
|
59
60
|
handleGeneralNotificationCount,
|
|
60
61
|
notificationData,
|
|
61
62
|
handleGetNotification,
|
|
63
|
+
retrieveUserDetailsData,
|
|
64
|
+
handleRetrieveUserDetails,
|
|
65
|
+
updateUserAccountData,
|
|
66
|
+
handleUpdateUserAccount
|
|
62
67
|
} = useHeader();
|
|
63
68
|
const { pathname } = useLocation();
|
|
64
69
|
const {
|
|
@@ -69,6 +74,7 @@ const HeaderComponent = (props) => {
|
|
|
69
74
|
defaultLang,
|
|
70
75
|
isLoading,
|
|
71
76
|
setIsLoading,
|
|
77
|
+
setDefaultLang
|
|
72
78
|
} = useContext(OutletContext);
|
|
73
79
|
const [selectedAccount, setSelectedAccount] = useState();
|
|
74
80
|
const { setDefaultAccount, handleSetDefaultAccount } = useHeader();
|
|
@@ -382,8 +388,17 @@ const HeaderComponent = (props) => {
|
|
|
382
388
|
handleGetUnreadNotification();
|
|
383
389
|
handleGeneralNotificationCount();
|
|
384
390
|
}, [notificationMarkReadData?.response]);
|
|
391
|
+
|
|
392
|
+
useEffect(() => {
|
|
393
|
+
if (generalData?.defaultAccount?.language) {
|
|
394
|
+
setDefaultLang(generalData?.defaultAccount?.language);
|
|
395
|
+
}
|
|
396
|
+
}, [generalData]);
|
|
397
|
+
|
|
398
|
+
|
|
385
399
|
const value = JSON?.parse(localStorage.getItem("defaultLang"));
|
|
386
400
|
const currentFlag = value?.flag;
|
|
401
|
+
const selectedLanguage = languagesData.find((lang) => lang?.slug === defaultLang);
|
|
387
402
|
//console.log("defaultLang", defaultLang);
|
|
388
403
|
|
|
389
404
|
// When Developer and on staging
|
|
@@ -489,7 +504,7 @@ const HeaderComponent = (props) => {
|
|
|
489
504
|
setIsOpen();
|
|
490
505
|
}}
|
|
491
506
|
>
|
|
492
|
-
<img src={currentFlag || usFlag} alt="" />
|
|
507
|
+
<img src={selectedLanguage?.flag || currentFlag || usFlag} alt="" />
|
|
493
508
|
<ArrowDownIcon />
|
|
494
509
|
</div>
|
|
495
510
|
{languageDropdown && (
|
|
@@ -30,6 +30,13 @@ const LanguageDropdown = ({ languageDropdown, setLanguageDropdown }) => {
|
|
|
30
30
|
isLoading,
|
|
31
31
|
setIsLoading,
|
|
32
32
|
} = useContext(OutletContext);
|
|
33
|
+
const {
|
|
34
|
+
retrieveUserDetailsData,
|
|
35
|
+
handleRetrieveUserDetails,
|
|
36
|
+
updateUserAccountData,
|
|
37
|
+
handleUpdateUserAccount,
|
|
38
|
+
} = useHeader();
|
|
39
|
+
|
|
33
40
|
const languagesData = [
|
|
34
41
|
{
|
|
35
42
|
name: "English",
|
|
@@ -139,10 +146,18 @@ const LanguageDropdown = ({ languageDropdown, setLanguageDropdown }) => {
|
|
|
139
146
|
? setIsLoading(false)
|
|
140
147
|
: setIsLoading(true);
|
|
141
148
|
localStorage.setItem("defaultLang", JSON.stringify(item));
|
|
149
|
+
if (generalData?.defaultAccount?.id) {
|
|
150
|
+
handleUpdateUserAccount(generalData?.defaultAccount?.id, {
|
|
151
|
+
...generalData?.selectedAccount?.metadata,
|
|
152
|
+
language: item?.slug,
|
|
153
|
+
});
|
|
154
|
+
handleRetrieveUserDetails({
|
|
155
|
+
language: item?.slug,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
142
158
|
}}
|
|
143
159
|
>
|
|
144
|
-
<img src={item?.flag} alt="" />{
|
|
145
|
-
<span>{findText(item?.name)}</span>
|
|
160
|
+
<img src={item?.flag} alt="" /> <span>{item?.name}</span>
|
|
146
161
|
</p>
|
|
147
162
|
))}
|
|
148
163
|
</>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import usFlag from "../../assets/images/usFlag.png";
|
|
2
|
+
import koreanFlag from "../../assets/images/koreaFlag.png";
|
|
3
|
+
|
|
4
|
+
export const languagesData = [
|
|
5
|
+
{
|
|
6
|
+
name: "English",
|
|
7
|
+
flag: usFlag,
|
|
8
|
+
slug: "en",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "Korean",
|
|
12
|
+
flag: koreanFlag,
|
|
13
|
+
slug: "ko",
|
|
14
|
+
},
|
|
15
|
+
];
|
package/src/components/index.js
CHANGED
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
export { default as Header } from
|
|
2
|
-
export { default as LoginHeader } from
|
|
3
|
-
export { default as Banner } from
|
|
4
|
-
export { default as SideNav } from
|
|
5
|
-
export { default as SideMenu } from
|
|
6
|
-
export { default as ProgressBar } from
|
|
7
|
-
export { default as Radio } from
|
|
8
|
-
export { default as Checkbox } from
|
|
9
|
-
export { default as CheckboxGroup } from
|
|
10
|
-
export { default as RequestList } from
|
|
11
|
-
export { default as CourseList } from
|
|
12
|
-
export { default as ApiProgressBar } from
|
|
13
|
-
export { default as ApiConsumption } from
|
|
14
|
-
export { default as Loader } from
|
|
15
|
-
export { default as SearchComponent } from
|
|
16
|
-
export { default as ButtonComponent } from
|
|
17
|
-
export { default as ToggleButtonComponent } from
|
|
18
|
-
export { default as InputComponent } from
|
|
19
|
-
export { default as MainLayout } from
|
|
20
|
-
export { default as SocialBtn } from
|
|
21
|
-
export { default as SuccessCard } from
|
|
22
|
-
export { default as DropDownComponent } from
|
|
23
|
-
export { default as SelectDropdown } from
|
|
24
|
-
export { default as SelectDropdownGraph } from
|
|
25
|
-
export { default as NotificationThresholdComponent } from
|
|
26
|
-
export { default as DevAPIdocs } from
|
|
27
|
-
export { default as Calender } from
|
|
28
|
-
export { default as ErrorPage } from
|
|
29
|
-
export { default as AppMainLayout } from
|
|
30
|
-
export { OutletContext as OutletContext } from
|
|
31
|
-
export { default as DatePickerCalender } from
|
|
32
|
-
export { default as TextEditor } from
|
|
33
|
-
export { default as MessageAddon } from
|
|
34
|
-
export { default as InstructorAccountSwitcher } from
|
|
35
|
-
export { default as InstructorRightBar } from
|
|
1
|
+
export { default as Header } from "./header/index";
|
|
2
|
+
export { default as LoginHeader } from "./header/login-header";
|
|
3
|
+
export { default as Banner } from "./banner/";
|
|
4
|
+
export { default as SideNav } from "./sideNav";
|
|
5
|
+
export { default as SideMenu } from "./sideBar/sideMenu";
|
|
6
|
+
export { default as ProgressBar } from "./progressBar";
|
|
7
|
+
export { default as Radio } from "./radio";
|
|
8
|
+
export { default as Checkbox } from "./checkBoxes/checkbox/index2";
|
|
9
|
+
export { default as CheckboxGroup } from "./checkBoxes/checkboxGroup";
|
|
10
|
+
export { default as RequestList } from "./friendRequest/friendRequestList";
|
|
11
|
+
export { default as CourseList } from "./course/courseList";
|
|
12
|
+
export { default as ApiProgressBar } from "./ApiProgress/ApiProgressBar";
|
|
13
|
+
export { default as ApiConsumption } from "./ApiProgress/ApiConsumption";
|
|
14
|
+
export { default as Loader } from "./loader";
|
|
15
|
+
export { default as SearchComponent } from "./searchBar";
|
|
16
|
+
export { default as ButtonComponent } from "./button";
|
|
17
|
+
export { default as ToggleButtonComponent } from "./toggle button";
|
|
18
|
+
export { default as InputComponent } from "./input";
|
|
19
|
+
export { default as MainLayout } from "./authentication/mainLayout";
|
|
20
|
+
export { default as SocialBtn } from "./button/socialBtn";
|
|
21
|
+
export { default as SuccessCard } from "./successCard/index";
|
|
22
|
+
export { default as DropDownComponent } from "./dropdown component/dropdown";
|
|
23
|
+
export { default as SelectDropdown } from "./select";
|
|
24
|
+
export { default as SelectDropdownGraph } from "./graph";
|
|
25
|
+
export { default as NotificationThresholdComponent } from "./notificationThreshold";
|
|
26
|
+
export { default as DevAPIdocs } from "./developerAPIdocs";
|
|
27
|
+
export { default as Calender } from "./calender/input";
|
|
28
|
+
export { default as ErrorPage } from "./errorPage";
|
|
29
|
+
export { default as AppMainLayout } from "./AppMainLayout";
|
|
30
|
+
export { OutletContext as OutletContext } from "./AppMainLayout";
|
|
31
|
+
export { default as DatePickerCalender } from "./datePicker";
|
|
32
|
+
export { default as TextEditor } from "./textEditor";
|
|
33
|
+
export { default as MessageAddon } from "./messageAddon/messages";
|
|
34
|
+
export { default as InstructorAccountSwitcher } from "./instructorAccountSwitcher";
|
|
35
|
+
export { default as InstructorRightBar } from "./fileRightBar/instructorRightBar";
|
|
36
36
|
|
|
37
|
-
export { default as EnterpriseRightBar } from
|
|
38
|
-
export { default as FullPageLoader } from
|
|
39
|
-
export { default as AdminAppMainLayout } from
|
|
40
|
-
export { default as PaginationComponent } from
|
|
41
|
-
export { default as VideoPlayer } from
|
|
42
|
-
export { default as AdminLogin } from
|
|
43
|
-
export { default as AdminResetPassword } from
|
|
44
|
-
export { default as AdminChangePassword } from
|
|
45
|
-
export { default as AdminPasswordSuccess } from
|
|
37
|
+
export { default as EnterpriseRightBar } from "./fileRightBar/enterpriseRightBar";
|
|
38
|
+
export { default as FullPageLoader } from "./fullPageLoader";
|
|
39
|
+
export { default as AdminAppMainLayout } from "./AdminAppMainLayout";
|
|
40
|
+
export { default as PaginationComponent } from "./paginate";
|
|
41
|
+
export { default as VideoPlayer } from "./video-player";
|
|
42
|
+
export { default as AdminLogin } from "./AdminLogin";
|
|
43
|
+
export { default as AdminResetPassword } from "./AdminResetPassword";
|
|
44
|
+
export { default as AdminChangePassword } from "./AdminResetPassword/change-password";
|
|
45
|
+
export { default as AdminPasswordSuccess } from "./AdminResetPassword/success-screen";
|
|
46
46
|
export { default as AdminDashboard } from "./AdminDashboard/admin-dashboard";
|
|
47
|
-
export { default as AdminNotification } from
|
|
48
|
-
export { default as AdminSecurity } from
|
|
49
|
-
export { default as GraphMap } from
|
|
50
|
-
export { default as AdminRolesPermissions } from
|
|
51
|
-
export { default as AdminCreateRolesPermissions } from
|
|
52
|
-
export { default as MobileLayout } from
|
|
53
|
-
export { default as useTranslation } from
|
|
54
|
-
export { default as preLoadWords } from "../hooks/utils/translation"
|
|
47
|
+
export { default as AdminNotification } from "./AdminNotification";
|
|
48
|
+
export { default as AdminSecurity } from "./AdminSecuritySettings";
|
|
49
|
+
export { default as GraphMap } from "./GraphMap";
|
|
50
|
+
export { default as AdminRolesPermissions } from "./AdminRolesPermission";
|
|
51
|
+
export { default as AdminCreateRolesPermissions } from "./AdminRolesPermission/create";
|
|
52
|
+
export { default as MobileLayout } from "./mobileLayout";
|
|
53
|
+
export { default as useTranslation } from "../hooks/useTranslation";
|
|
54
|
+
export { default as preLoadWords } from "../hooks/utils/translation";
|
|
55
|
+
export { default as ImageComponent } from "./ImageComponent";
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState } from "react";
|
|
1
|
+
import React, { useCallback, useContext, useEffect, useState } from "react";
|
|
2
2
|
import loadTranslations from "./utils/translation";
|
|
3
3
|
import { db } from "./utils/db";
|
|
4
4
|
import { useLiveQuery } from "dexie-react-hooks";
|
|
5
|
+
import { OutletContext } from "../components";
|
|
5
6
|
|
|
6
7
|
const useTranslation = () => {
|
|
7
8
|
const screenId = btoa(window.location.href);
|
|
8
9
|
const value = JSON?.parse(localStorage.getItem("defaultLang"));
|
|
10
|
+
const { generalData } = useContext(OutletContext);
|
|
9
11
|
|
|
10
12
|
const [defaultLang, setDefaultLang] = useState(value?.slug ?? "en");
|
|
11
13
|
const [isLoading, setIsLoading] = useState(false);
|
|
12
14
|
const [textSchemaLoading, setTextSchemaLoading] = useState(true);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (generalData?.defaultAccount?.language) {
|
|
17
|
+
setDefaultLang(generalData?.defaultAccount?.language);
|
|
18
|
+
}
|
|
19
|
+
}, [generalData]);
|
|
20
|
+
|
|
13
21
|
/**
|
|
14
22
|
* @type {{key: string; value: string; updatedAt: string; screenId: string}[]}
|
|
15
23
|
*/
|