l-min-components 1.0.1042 → 1.0.1050
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 +1 -1
- package/src/components/AppMainLayout/index.jsx +10 -8
- package/src/components/header/index.jsx +1 -1
- package/src/components/instructorAccountSwitcher/index.jsx +18 -8
- package/src/components/messageAddon/InputSection/index.jsx +14 -27
- package/src/components/messageAddon/assets/svg/check_circle.jsx +27 -16
- package/src/components/messageAddon/hooks/useMessaging.js +23 -2
- package/src/components/messageAddon/messages/messages.jsx +30 -22
package/package.json
CHANGED
|
@@ -294,15 +294,17 @@ const AppMainLayout = () => {
|
|
|
294
294
|
}
|
|
295
295
|
</LeftLayout>
|
|
296
296
|
<CenterLayout isOpen={isOpen} style={centerLayoutStyle}>
|
|
297
|
-
{
|
|
297
|
+
{
|
|
298
|
+
// window.location.pathname.includes("instructor") &&
|
|
298
299
|
!window.location.pathname.includes("enterprise") &&
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
300
|
+
!window.location.pathname.includes("manage-teams") && (
|
|
301
|
+
<InstructorAccountSwitcher
|
|
302
|
+
setAccountType={setAffiliatesActive}
|
|
303
|
+
generalData={generalData}
|
|
304
|
+
onChange={(v) => setAffiliateAccount(v)}
|
|
305
|
+
/>
|
|
306
|
+
)
|
|
307
|
+
}
|
|
306
308
|
|
|
307
309
|
{window.location.pathname.includes("enterprise") &&
|
|
308
310
|
planState === "GRACE PERIOD" ? (
|
|
@@ -93,7 +93,7 @@ const HeaderComponent = (props) => {
|
|
|
93
93
|
handleGetUnreadNotification(accountType);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
if (accountType
|
|
96
|
+
if (accountType && accountType === "personal") {
|
|
97
97
|
handleGetUnreadNotificationPersonal()
|
|
98
98
|
}
|
|
99
99
|
}, [accountType]);
|
|
@@ -32,10 +32,12 @@ const InstructorAccountSwitcher = ({ generalData, onChange }) => {
|
|
|
32
32
|
}, [generalData?.selectedAccount, search]);
|
|
33
33
|
|
|
34
34
|
const dropdownList = getAllAffiliateData?.data?.results?.map((item) => {
|
|
35
|
-
const image = item?.profile_photo?.url;
|
|
35
|
+
const image = item?.profile_photo?.url || item?.profile_photo[1][1];
|
|
36
36
|
return { name: item?.display_name, image, id: item?.id };
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
+
console.log(dropdownList, getAllAffiliateData);
|
|
40
|
+
|
|
39
41
|
const [dropdown, setDropdown] = useState(false);
|
|
40
42
|
|
|
41
43
|
const getCookie = () => {
|
|
@@ -72,16 +74,24 @@ const InstructorAccountSwitcher = ({ generalData, onChange }) => {
|
|
|
72
74
|
};
|
|
73
75
|
|
|
74
76
|
const handleSwitch = (value) => {
|
|
75
|
-
if (
|
|
76
|
-
if (
|
|
77
|
-
|
|
77
|
+
if (selectedValue) {
|
|
78
|
+
if (value === 2) {
|
|
79
|
+
if (selectedValue) {
|
|
80
|
+
setCookie(selectedValue?.id);
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
if (cookieValue) {
|
|
84
|
+
deleteCookies("affiliateAccount");
|
|
85
|
+
}
|
|
78
86
|
}
|
|
87
|
+
window.location.href = "/instructor/dashboard";
|
|
79
88
|
} else {
|
|
80
|
-
if (
|
|
81
|
-
|
|
89
|
+
if (value === 2) {
|
|
90
|
+
setSwitchValue("affiliates");
|
|
91
|
+
} else {
|
|
92
|
+
setSwitchValue(null);
|
|
82
93
|
}
|
|
83
94
|
}
|
|
84
|
-
window.location.href = "/instructor/dashboard";
|
|
85
95
|
};
|
|
86
96
|
|
|
87
97
|
useEffect(() => {
|
|
@@ -241,7 +251,7 @@ const Container = styled.div`
|
|
|
241
251
|
background: #ffffff;
|
|
242
252
|
border-radius: 25px;
|
|
243
253
|
height: 60px;
|
|
244
|
-
margin-bottom:
|
|
254
|
+
margin-bottom: 16px;
|
|
245
255
|
|
|
246
256
|
.left {
|
|
247
257
|
> p {
|
|
@@ -43,6 +43,8 @@ const InputSection = ({
|
|
|
43
43
|
accountType,
|
|
44
44
|
affiliates,
|
|
45
45
|
courseID,
|
|
46
|
+
handleCreateMessage,
|
|
47
|
+
createMessageData,
|
|
46
48
|
}) => {
|
|
47
49
|
const [showEmoji, setShowEmoji] = useState();
|
|
48
50
|
const [inputMethod, setInputMethod] = useState("text"); // text | recorder
|
|
@@ -56,8 +58,7 @@ const InputSection = ({
|
|
|
56
58
|
|
|
57
59
|
const imageRef = useRef();
|
|
58
60
|
const {
|
|
59
|
-
|
|
60
|
-
createMessageData,
|
|
61
|
+
|
|
61
62
|
handleCreateMessageWithMedia,
|
|
62
63
|
createMessageWithMediaData,
|
|
63
64
|
createMessageAffiliateData,
|
|
@@ -94,29 +95,10 @@ const InputSection = ({
|
|
|
94
95
|
if (inputMethod === "text") {
|
|
95
96
|
// setNewMessages((prev) => [...prev, text]);
|
|
96
97
|
setIsMessageSending(true);
|
|
97
|
-
if (affiliates && accountType === "instructor") {
|
|
98
|
-
setTimeout(() => {
|
|
99
|
-
handleCreateMessageAffiliate(userID, text);
|
|
100
|
-
}, 1000);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (!affiliates && accountType === "instructor") {
|
|
104
|
-
setTimeout(() => {
|
|
105
|
-
handleCreateMessage(userID, accountType, text);
|
|
106
|
-
}, 1000);
|
|
107
|
-
}
|
|
108
98
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}, 1000);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (accountType === "personal") {
|
|
116
|
-
setTimeout(() => {
|
|
117
|
-
handleCreateMessagePersonal(userID, text, courseID);
|
|
118
|
-
}, 1000);
|
|
119
|
-
}
|
|
99
|
+
setTimeout(() => {
|
|
100
|
+
handleCreateMessage(userID, accountType, text, courseID, "");
|
|
101
|
+
}, 1000);
|
|
120
102
|
}
|
|
121
103
|
};
|
|
122
104
|
|
|
@@ -255,12 +237,17 @@ const InputSection = ({
|
|
|
255
237
|
</div>
|
|
256
238
|
<button
|
|
257
239
|
className={`send-box ${
|
|
258
|
-
!text.text &&
|
|
240
|
+
(!text.text && inputMethod !== "recorder") ||
|
|
241
|
+
createMessageData?.loading ||
|
|
242
|
+
recording
|
|
243
|
+
? "disabled"
|
|
244
|
+
: ""
|
|
259
245
|
}`}
|
|
260
246
|
onClick={handleSendMessage}
|
|
261
247
|
disabled={
|
|
262
|
-
!text.text &&
|
|
263
|
-
|
|
248
|
+
(!text.text && inputMethod !== "recorder") ||
|
|
249
|
+
createMessageData?.loading ||
|
|
250
|
+
recording
|
|
264
251
|
}
|
|
265
252
|
>
|
|
266
253
|
<SendIcon />
|