l-min-components 1.0.805 → 1.0.817
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 +4 -1
- package/src/components/AdminResetPassword/index.jsx +2 -2
- package/src/components/AdminSecuritySettings/2fa/index.jsx +1 -1
- package/src/components/AdminSecuritySettings/modals/otp-password-modal.jsx +9 -6
- package/src/components/ApiProgress/ApiConsumption/index.jsx +6 -8
- package/src/components/AppMainLayout/index.jsx +8 -7
- package/src/components/banner/index.jsx +31 -23
- package/src/components/button/index.jsx +103 -100
- package/src/components/course/courseList/index.jsx +7 -4
- package/src/components/deactivated/modal/subscription-expired-modal.jsx +18 -22
- package/src/components/deactivated/useAccount.js +1 -11
- package/src/components/dropdown component/dropdown.jsx +73 -75
- package/src/components/errorPage/index.jsx +65 -63
- package/src/components/friendRequest/friendRequestCard/doc.md +4 -3
- package/src/components/header/account-dropdown.jsx +43 -52
- package/src/components/header/getHeaderDetails.js +65 -65
- package/src/components/header/index.jsx +19 -16
- package/src/components/header/languageDropdown.jsx +18 -3
- package/src/components/header/login-header.jsx +7 -1
- package/src/components/input/index.jsx +30 -30
- package/src/components/messageAddon/InputSection/index.jsx +14 -19
- package/src/components/messageAddon/hooks/useFriends.js +1 -1
- package/src/components/messageAddon/hooks/useMedia.js +5 -5
- package/src/components/messageAddon/hooks/useMessaging.js +8 -8
- package/src/components/messageAddon/hooks/useRooms.js +12 -12
- package/src/components/messageAddon/messages/messagebox/messageBubble.jsx +5 -5
- package/src/components/messageAddon/messages/messagebox/waveSurferPlayer.jsx +3 -6
- package/src/components/messageAddon/messages/messages.jsx +13 -12
- package/src/components/notificationThreshold/index.jsx +2 -3
- package/src/components/notificationThreshold/slider.jsx +1 -1
- package/src/components/radio/doc.md +7 -6
- package/src/components/searchBar/doc.md +19 -18
- package/src/components/sideBar/sideMenu/index.jsx +6 -7
- package/src/components/sideBar/userCard/index.jsx +4 -6
- package/src/components/sideNav/index.jsx +6 -3
- package/src/components/textEditor/index.jsx +23 -45
- package/src/hooks/useTranslation.jsx +42 -5
- package/src/hooks/utils/axiosConfig.js +117 -0
- package/src/hooks/utils/db.js +13 -0
- package/src/hooks/utils/translation.js +61 -53
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "l-min-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.817",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"src/assets",
|
|
@@ -18,8 +18,11 @@
|
|
|
18
18
|
"axios-hooks": "^4.0.0",
|
|
19
19
|
"chart.js": "4.4.1",
|
|
20
20
|
"classnames": "^2.3.2",
|
|
21
|
+
"dexie": "^4.0.8",
|
|
22
|
+
"dexie-react-hooks": "^1.1.7",
|
|
21
23
|
"emoji-picker-react": "^4.4.10",
|
|
22
24
|
"i": "^0.3.7",
|
|
25
|
+
"iso-639-1": "^3.1.2",
|
|
23
26
|
"js-cookie": "^3.0.5",
|
|
24
27
|
"lottie-web": "^5.12.2",
|
|
25
28
|
"moment": "^2.29.4",
|
|
@@ -16,7 +16,7 @@ const AdminChangePassword = () => {
|
|
|
16
16
|
</div>
|
|
17
17
|
<div className="reset_form">
|
|
18
18
|
<div className="rsf_header">
|
|
19
|
-
|
|
19
|
+
<span onClick={() => navigate(-1)}>
|
|
20
20
|
<BackArrow /> Back{" "}
|
|
21
21
|
</span>
|
|
22
22
|
<img src={logo} alt="" />
|
|
@@ -25,7 +25,7 @@ const AdminChangePassword = () => {
|
|
|
25
25
|
<div className="form_card">
|
|
26
26
|
<h5 className="reset_txt"> RESET PASSWORD </h5>
|
|
27
27
|
<p className="reset_subtile">
|
|
28
|
-
|
|
28
|
+
Enter your email to reset your password
|
|
29
29
|
</p>
|
|
30
30
|
|
|
31
31
|
<form action="">
|
|
@@ -76,7 +76,7 @@ const OTPSecurityModal = (props) => {
|
|
|
76
76
|
const handlePaste = (event, index) => {
|
|
77
77
|
event.preventDefault();
|
|
78
78
|
const pastedText = event.clipboardData.getData("text");
|
|
79
|
-
console.log(pastedText, "text");
|
|
79
|
+
//console.log(pastedText, "text");
|
|
80
80
|
const sanitizedText = pastedText.replace(/[^0-9]/g, "").slice(0, 6);
|
|
81
81
|
|
|
82
82
|
const textArray = [];
|
|
@@ -97,8 +97,7 @@ const OTPSecurityModal = (props) => {
|
|
|
97
97
|
style={modalCustomStyles}
|
|
98
98
|
closeTimeoutMS={0}
|
|
99
99
|
ariaHideApp={false}
|
|
100
|
-
contentLabel="Selected Option"
|
|
101
|
-
>
|
|
100
|
+
contentLabel="Selected Option">
|
|
102
101
|
<ModalCardContainer>
|
|
103
102
|
<CloseModalButton onClick={props.onRequestClose}>
|
|
104
103
|
<IoMdClose />
|
|
@@ -110,9 +109,13 @@ const OTPSecurityModal = (props) => {
|
|
|
110
109
|
<CardBody>
|
|
111
110
|
<p className="mdld-2fa-title">
|
|
112
111
|
An OTP has been sent to your{" "}
|
|
113
|
-
{props.OTPtype === "phone"
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
{props.OTPtype === "phone" ? (
|
|
113
|
+
<>
|
|
114
|
+
Phone <br /> number that ends with
|
|
115
|
+
</>
|
|
116
|
+
) : (
|
|
117
|
+
"email address"
|
|
118
|
+
)}{" "}
|
|
116
119
|
{props.OTPvalue}
|
|
117
120
|
</p>
|
|
118
121
|
|
|
@@ -3,9 +3,9 @@ import { Container } from "./styles";
|
|
|
3
3
|
import Switch from "../toggle";
|
|
4
4
|
import ProgressBar from "../ApiProgressBar";
|
|
5
5
|
import { BsCheck } from "react-icons/bs";
|
|
6
|
-
import Alerm from "./assets/Vector"
|
|
6
|
+
import Alerm from "./assets/Vector";
|
|
7
7
|
|
|
8
|
-
const ApiConsumption = ({onClick}) => {
|
|
8
|
+
const ApiConsumption = ({ onClick }) => {
|
|
9
9
|
const [disabled, setDisabled] = useState(false);
|
|
10
10
|
const [used, setUsed] = useState(300);
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ const ApiConsumption = ({onClick}) => {
|
|
|
13
13
|
setUsed(newUsed);
|
|
14
14
|
};
|
|
15
15
|
const handleToggle = (e) => {
|
|
16
|
-
console.log(e.target.checked);
|
|
16
|
+
//console.log(e.target.checked);
|
|
17
17
|
|
|
18
18
|
setDisabled(e.target.checked);
|
|
19
19
|
};
|
|
@@ -30,18 +30,16 @@ const ApiConsumption = ({onClick}) => {
|
|
|
30
30
|
onChange={handleToggle}
|
|
31
31
|
/>
|
|
32
32
|
</div>
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
<p className="v-text">View Api consumption (sec)</p>
|
|
35
35
|
</div>
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
<div className="notify">
|
|
38
38
|
<p>Set Notification</p>
|
|
39
39
|
<div className="bell" onClick={onClick}>
|
|
40
|
-
<Alerm/>
|
|
40
|
+
<Alerm />
|
|
41
41
|
</div>
|
|
42
|
-
|
|
43
42
|
</div>
|
|
44
|
-
|
|
45
43
|
</div>
|
|
46
44
|
<ProgressBar
|
|
47
45
|
total={1000}
|
|
@@ -144,7 +144,7 @@ const AppMainLayout = () => {
|
|
|
144
144
|
setEnvType("live");
|
|
145
145
|
}
|
|
146
146
|
}, []);
|
|
147
|
-
console.log("envType", envType);
|
|
147
|
+
//console.log("envType", envType);
|
|
148
148
|
|
|
149
149
|
useEffect(() => {
|
|
150
150
|
handleGetUserPlan();
|
|
@@ -153,8 +153,9 @@ const AppMainLayout = () => {
|
|
|
153
153
|
const currentPlan = userPlanData?.data?.current_plan;
|
|
154
154
|
const planState = userPlanData?.data?.state;
|
|
155
155
|
|
|
156
|
-
const { textSchema, setDefaultLang, defaultLang, findText } =
|
|
157
|
-
|
|
156
|
+
const { textSchema, setDefaultLang, defaultLang, findText, isLoading, setIsLoading } =
|
|
157
|
+
useTranslation();
|
|
158
|
+
// //console.log(findText());
|
|
158
159
|
return (
|
|
159
160
|
textSchema && (
|
|
160
161
|
<OutletContext.Provider
|
|
@@ -163,6 +164,8 @@ const AppMainLayout = () => {
|
|
|
163
164
|
findText,
|
|
164
165
|
defaultLang,
|
|
165
166
|
setDefaultLang,
|
|
167
|
+
isLoading,
|
|
168
|
+
setIsLoading,
|
|
166
169
|
setRightComponent,
|
|
167
170
|
setRightLayout,
|
|
168
171
|
generalData,
|
|
@@ -190,16 +193,14 @@ const AppMainLayout = () => {
|
|
|
190
193
|
setNewNotifications,
|
|
191
194
|
notificationMarkReadData,
|
|
192
195
|
handleGetNotificationMarkRead,
|
|
193
|
-
}}
|
|
194
|
-
>
|
|
196
|
+
}}>
|
|
195
197
|
{/* display mobile layout on device width*/}
|
|
196
198
|
{deviceWidth < 1200 ? (
|
|
197
199
|
<MobileLayout />
|
|
198
200
|
) : (
|
|
199
201
|
<Layout
|
|
200
202
|
coming={coming}
|
|
201
|
-
hasLayoutBackgroundImage={hasLayoutBackgroundImage}
|
|
202
|
-
>
|
|
203
|
+
hasLayoutBackgroundImage={hasLayoutBackgroundImage}>
|
|
203
204
|
<HeaderComponent setNewNotifications={setNewNotifications} />
|
|
204
205
|
<MainLayout coming={coming}>
|
|
205
206
|
<LeftLayout>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
2
|
import {
|
|
3
3
|
AbsoluteSVG,
|
|
4
4
|
ArrowIcon,
|
|
@@ -11,31 +11,39 @@ import {
|
|
|
11
11
|
import BannerImg from "./assets/banner.png";
|
|
12
12
|
import Button from "../button";
|
|
13
13
|
import { FaArrowRight } from "react-icons/fa";
|
|
14
|
+
import { OutletContext } from "../AppMainLayout";
|
|
15
|
+
import useTranslation from "../../hooks/useTranslation";
|
|
14
16
|
|
|
15
17
|
const Banner = () => {
|
|
18
|
+
const { textSchema, findText } = useTranslation();
|
|
19
|
+
|
|
16
20
|
return (
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
textSchema && (
|
|
22
|
+
<BannerWrapper>
|
|
23
|
+
<BannerTitle>
|
|
24
|
+
{" "}
|
|
25
|
+
{findText("Learn languages, anytime, anywhere.")}
|
|
26
|
+
</BannerTitle>
|
|
27
|
+
<BannerSubtitle>
|
|
28
|
+
{findText(`Join millions of users from all over the world to learn foreign languages`)}
|
|
29
|
+
</BannerSubtitle>
|
|
30
|
+
<BannerImage src={BannerImg} alt="Banner" />
|
|
31
|
+
<Button
|
|
32
|
+
type="primary"
|
|
33
|
+
text="Get started"
|
|
34
|
+
icon={{
|
|
35
|
+
jsx: FaArrowRight,
|
|
36
|
+
right: true,
|
|
37
|
+
}}
|
|
38
|
+
styles={{
|
|
39
|
+
marginTop: "29px",
|
|
40
|
+
fontSize: "16px",
|
|
41
|
+
width: "200px",
|
|
42
|
+
gap: "8px",
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
</BannerWrapper>
|
|
46
|
+
)
|
|
39
47
|
);
|
|
40
48
|
};
|
|
41
49
|
|
|
@@ -25,103 +25,105 @@ const ButtonComponent = (props) => {
|
|
|
25
25
|
const handleClick = useCallback((e) => {
|
|
26
26
|
props.onClick && props.onClick(e);
|
|
27
27
|
}, []);
|
|
28
|
-
// console.log(props);
|
|
28
|
+
// //console.log(props);
|
|
29
29
|
switch (props.type) {
|
|
30
30
|
case "primary":
|
|
31
31
|
return (
|
|
32
|
-
textSchema &&
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{...{
|
|
40
|
-
width: props.icon.width,
|
|
41
|
-
height: props.icon.height,
|
|
42
|
-
stroke: props.icon.stroke,
|
|
43
|
-
}}
|
|
44
|
-
/>
|
|
45
|
-
) : (
|
|
46
|
-
props.icon?.left && (
|
|
47
|
-
<TestIcon
|
|
32
|
+
textSchema && (
|
|
33
|
+
<Button
|
|
34
|
+
disabled={props.disabled}
|
|
35
|
+
onClick={handleClick}
|
|
36
|
+
style={props.styles}>
|
|
37
|
+
{props.icon?.left && props.icon.jsx ? (
|
|
38
|
+
<props.icon.jsx
|
|
48
39
|
{...{
|
|
49
40
|
width: props.icon.width,
|
|
50
41
|
height: props.icon.height,
|
|
51
42
|
stroke: props.icon.stroke,
|
|
52
43
|
}}
|
|
53
44
|
/>
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
props.icon?.right && (
|
|
67
|
-
<
|
|
45
|
+
) : (
|
|
46
|
+
props.icon?.left && (
|
|
47
|
+
<TestIcon
|
|
48
|
+
{...{
|
|
49
|
+
width: props.icon.width,
|
|
50
|
+
height: props.icon.height,
|
|
51
|
+
stroke: props.icon.stroke,
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
54
|
+
)
|
|
55
|
+
)}
|
|
56
|
+
{findText(props.text) ?? "Text"}
|
|
57
|
+
{props.icon?.right && props.icon.jsx ? (
|
|
58
|
+
<props.icon.jsx
|
|
68
59
|
{...{
|
|
69
60
|
width: props.icon.width,
|
|
70
61
|
height: props.icon.height,
|
|
71
62
|
stroke: props.icon.stroke,
|
|
72
63
|
}}
|
|
73
64
|
/>
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
|
|
65
|
+
) : (
|
|
66
|
+
props.icon?.right && (
|
|
67
|
+
<TestIcon
|
|
68
|
+
{...{
|
|
69
|
+
width: props.icon.width,
|
|
70
|
+
height: props.icon.height,
|
|
71
|
+
stroke: props.icon.stroke,
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
)
|
|
75
|
+
)}
|
|
76
|
+
</Button>
|
|
77
|
+
)
|
|
77
78
|
);
|
|
78
79
|
case "secondary":
|
|
79
80
|
return (
|
|
80
|
-
textSchema &&
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
{...{
|
|
88
|
-
width: props.icon.width,
|
|
89
|
-
height: props.icon.height,
|
|
90
|
-
stroke: props.icon.stroke,
|
|
91
|
-
}}
|
|
92
|
-
/>
|
|
93
|
-
) : (
|
|
94
|
-
props.icon?.left && (
|
|
95
|
-
<TestIcon
|
|
81
|
+
textSchema && (
|
|
82
|
+
<SecondaryButton
|
|
83
|
+
disabled={props.disabled}
|
|
84
|
+
onClick={handleClick}
|
|
85
|
+
style={props.styles}>
|
|
86
|
+
{props.icon?.left && props.icon.jsx ? (
|
|
87
|
+
<props.icon.jsx
|
|
96
88
|
{...{
|
|
97
89
|
width: props.icon.width,
|
|
98
90
|
height: props.icon.height,
|
|
99
91
|
stroke: props.icon.stroke,
|
|
100
92
|
}}
|
|
101
93
|
/>
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
props.icon?.right && (
|
|
115
|
-
<
|
|
94
|
+
) : (
|
|
95
|
+
props.icon?.left && (
|
|
96
|
+
<TestIcon
|
|
97
|
+
{...{
|
|
98
|
+
width: props.icon.width,
|
|
99
|
+
height: props.icon.height,
|
|
100
|
+
stroke: props.icon.stroke,
|
|
101
|
+
}}
|
|
102
|
+
/>
|
|
103
|
+
)
|
|
104
|
+
)}
|
|
105
|
+
{findText(props.text) ?? "Text"}
|
|
106
|
+
{props.icon?.right && props.icon.jsx ? (
|
|
107
|
+
<props.icon.jsx
|
|
116
108
|
{...{
|
|
117
109
|
width: props.icon.width,
|
|
118
110
|
height: props.icon.height,
|
|
119
111
|
stroke: props.icon.stroke,
|
|
120
112
|
}}
|
|
121
113
|
/>
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
|
|
114
|
+
) : (
|
|
115
|
+
props.icon?.right && (
|
|
116
|
+
<TestIcon
|
|
117
|
+
{...{
|
|
118
|
+
width: props.icon.width,
|
|
119
|
+
height: props.icon.height,
|
|
120
|
+
stroke: props.icon.stroke,
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
)
|
|
124
|
+
)}
|
|
125
|
+
</SecondaryButton>
|
|
126
|
+
)
|
|
125
127
|
);
|
|
126
128
|
case "tertiary":
|
|
127
129
|
return (
|
|
@@ -172,51 +174,52 @@ const ButtonComponent = (props) => {
|
|
|
172
174
|
);
|
|
173
175
|
default:
|
|
174
176
|
return (
|
|
175
|
-
textSchema &&
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
{...{
|
|
183
|
-
width: props.icon.width,
|
|
184
|
-
height: props.icon.height,
|
|
185
|
-
stroke: props.icon.stroke,
|
|
186
|
-
}}
|
|
187
|
-
/>
|
|
188
|
-
) : (
|
|
189
|
-
props.icon?.left && (
|
|
190
|
-
<TestIcon
|
|
177
|
+
textSchema && (
|
|
178
|
+
<Button
|
|
179
|
+
disabled={props.disabled}
|
|
180
|
+
onClick={handleClick}
|
|
181
|
+
style={props.styles}>
|
|
182
|
+
{props.icon?.left && props.icon.jsx ? (
|
|
183
|
+
<props.icon.jsx
|
|
191
184
|
{...{
|
|
192
185
|
width: props.icon.width,
|
|
193
186
|
height: props.icon.height,
|
|
194
187
|
stroke: props.icon.stroke,
|
|
195
188
|
}}
|
|
196
189
|
/>
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
props.icon?.right && (
|
|
210
|
-
<
|
|
190
|
+
) : (
|
|
191
|
+
props.icon?.left && (
|
|
192
|
+
<TestIcon
|
|
193
|
+
{...{
|
|
194
|
+
width: props.icon.width,
|
|
195
|
+
height: props.icon.height,
|
|
196
|
+
stroke: props.icon.stroke,
|
|
197
|
+
}}
|
|
198
|
+
/>
|
|
199
|
+
)
|
|
200
|
+
)}
|
|
201
|
+
{findText(props.text) ?? "Text"}
|
|
202
|
+
{props.icon?.right && props.icon.jsx ? (
|
|
203
|
+
<props.icon.jsx
|
|
211
204
|
{...{
|
|
212
205
|
width: props.icon.width,
|
|
213
206
|
height: props.icon.height,
|
|
214
207
|
stroke: props.icon.stroke,
|
|
215
208
|
}}
|
|
216
209
|
/>
|
|
217
|
-
)
|
|
218
|
-
|
|
219
|
-
|
|
210
|
+
) : (
|
|
211
|
+
props.icon?.right && (
|
|
212
|
+
<TestIcon
|
|
213
|
+
{...{
|
|
214
|
+
width: props.icon.width,
|
|
215
|
+
height: props.icon.height,
|
|
216
|
+
stroke: props.icon.stroke,
|
|
217
|
+
}}
|
|
218
|
+
/>
|
|
219
|
+
)
|
|
220
|
+
)}
|
|
221
|
+
</Button>
|
|
222
|
+
)
|
|
220
223
|
);
|
|
221
224
|
}
|
|
222
225
|
};
|
|
@@ -9,27 +9,30 @@ const CourseList = ({ courses, onCourseSelect }) => {
|
|
|
9
9
|
|
|
10
10
|
// const handleCourseSelect = (courseId) => {
|
|
11
11
|
// setSelectedCourseId(courseId);
|
|
12
|
-
// console.log(selectedCourseId);
|
|
12
|
+
// //console.log(selectedCourseId);
|
|
13
13
|
// // onCourseSelect(courseId);
|
|
14
14
|
// };
|
|
15
15
|
|
|
16
16
|
const handleCourseSelect = (courseId) => {
|
|
17
17
|
if (selectedCourseIds.includes(courseId)) {
|
|
18
|
-
setSelectedCourseIds((prevSelected) =>
|
|
18
|
+
setSelectedCourseIds((prevSelected) =>
|
|
19
19
|
prevSelected.filter((id) => id !== courseId)
|
|
20
20
|
);
|
|
21
21
|
} else {
|
|
22
22
|
// Otherwise, add the course ID to the array
|
|
23
23
|
setSelectedCourseIds((prevSelected) => [...prevSelected, courseId]);
|
|
24
24
|
}
|
|
25
|
-
console.log(selectedCourseIds);
|
|
25
|
+
//console.log(selectedCourseIds);
|
|
26
26
|
// onCourseSelect(courseId); // Adapt this callback for multiple selections if necessary
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
30
|
<CourseListWrapper>
|
|
31
31
|
{courses.map((course) => (
|
|
32
|
-
<div
|
|
32
|
+
<div
|
|
33
|
+
className="card"
|
|
34
|
+
key={course.id}
|
|
35
|
+
onClick={() => handleCourseSelect(course.id)}>
|
|
33
36
|
<CourseCard
|
|
34
37
|
course={course}
|
|
35
38
|
isSelected={selectedCourseIds.includes(course.id)}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./index.styled";
|
|
10
10
|
import Modal from "react-modal";
|
|
11
11
|
import ButtonComponent from "../../button";
|
|
12
|
-
import RemoveUser from "./img/removeUser.png"
|
|
12
|
+
import RemoveUser from "./img/removeUser.png";
|
|
13
13
|
import { ErrorBookIcon } from "./img/book";
|
|
14
14
|
import moment from "moment";
|
|
15
15
|
import { toast, ToastContainer } from "react-toastify";
|
|
@@ -99,30 +99,27 @@ const SubscriptionExpiredModal = ({
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
const expiryDate = moment("2024-05-31",
|
|
103
|
-
"YYYY-MM-DD"); // Replace with your expiry date
|
|
102
|
+
const expiryDate = moment("2024-05-31", "YYYY-MM-DD"); // Replace with your expiry date
|
|
104
103
|
|
|
105
|
-
const isWithin10Days = moment().add(10,
|
|
104
|
+
const isWithin10Days = moment().add(10, "days").isSameOrBefore(expiryDate);
|
|
106
105
|
|
|
107
|
-
if (isWithin10Days) {
|
|
108
|
-
|
|
109
|
-
} else {
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
console.log(isWithin10Days)
|
|
106
|
+
if (isWithin10Days) {
|
|
107
|
+
//console.log('Expiry date is within 10 days');
|
|
108
|
+
} else {
|
|
109
|
+
//console.log('Expiry date is more than 10 days away');
|
|
110
|
+
}
|
|
111
|
+
//console.log(isWithin10Days)
|
|
113
112
|
|
|
113
|
+
const [daysLeft, setDaysLeft] = useState(null);
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const now = moment();
|
|
120
|
-
const diff = targetDate.diff(now, 'days');
|
|
121
|
-
|
|
122
|
-
setDaysLeft(diff);
|
|
123
|
-
}, [expiryDate]);
|
|
124
|
-
console.log(daysLeft)
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
const targetDate = moment(expiryDate);
|
|
117
|
+
const now = moment();
|
|
118
|
+
const diff = targetDate.diff(now, "days");
|
|
125
119
|
|
|
120
|
+
setDaysLeft(diff);
|
|
121
|
+
}, [expiryDate]);
|
|
122
|
+
//console.log(daysLeft)
|
|
126
123
|
|
|
127
124
|
return (
|
|
128
125
|
<Modal
|
|
@@ -132,8 +129,7 @@ console.log(daysLeft)
|
|
|
132
129
|
closeTimeoutMS={1000}
|
|
133
130
|
ariaHideApp={false}
|
|
134
131
|
contentLabel="Selected Option"
|
|
135
|
-
shouldCloseOnOverlayClick={false}
|
|
136
|
-
>
|
|
132
|
+
shouldCloseOnOverlayClick={false}>
|
|
137
133
|
<ModalCardContainer>
|
|
138
134
|
{/* <CloseModalButton
|
|
139
135
|
onClick={() => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import useAxios from "axios-hooks";
|
|
2
2
|
|
|
3
3
|
const useAccount = () => {
|
|
4
|
-
|
|
5
4
|
// current plan
|
|
6
5
|
const [{ ...userPlanData }, getUserPlan] = useAxios(
|
|
7
6
|
{
|
|
@@ -18,22 +17,13 @@ const useAccount = () => {
|
|
|
18
17
|
try {
|
|
19
18
|
await getUserPlan();
|
|
20
19
|
} catch (err) {
|
|
21
|
-
console.log(err);
|
|
20
|
+
//console.log(err);
|
|
22
21
|
}
|
|
23
22
|
};
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
24
|
return {
|
|
32
|
-
|
|
33
25
|
userPlanData,
|
|
34
26
|
handleGetUserPlan,
|
|
35
|
-
|
|
36
|
-
|
|
37
27
|
};
|
|
38
28
|
};
|
|
39
29
|
export default useAccount;
|