l-min-components 1.0.1050 → 1.0.1055

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.0.1050",
3
+ "version": "1.0.1055",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -269,7 +269,7 @@ const AppMainLayout = () => {
269
269
  <SideMenu
270
270
  user={user}
271
271
  routes={sideMenuOptions}
272
- affiliatesActive={affiliatesActive}
272
+ affiliatesActive={affiliateAccount}
273
273
  userType={generalData?.selectedAccount?.type?.toLowerCase()}
274
274
  isOpen={isOpen}
275
275
  setIsOpen={setIsOpen}
@@ -294,17 +294,15 @@ const AppMainLayout = () => {
294
294
  }
295
295
  </LeftLayout>
296
296
  <CenterLayout isOpen={isOpen} style={centerLayoutStyle}>
297
- {
298
- // window.location.pathname.includes("instructor") &&
297
+ {window.location.pathname.includes("instructor") &&
299
298
  !window.location.pathname.includes("enterprise") &&
300
- !window.location.pathname.includes("manage-teams") && (
301
- <InstructorAccountSwitcher
302
- setAccountType={setAffiliatesActive}
303
- generalData={generalData}
304
- onChange={(v) => setAffiliateAccount(v)}
305
- />
306
- )
307
- }
299
+ !window.location.pathname.includes("manage-teams") && (
300
+ <InstructorAccountSwitcher
301
+ setAccountType={setAffiliatesActive}
302
+ generalData={generalData}
303
+ onChange={(v) => setAffiliateAccount(v)}
304
+ />
305
+ )}
308
306
 
309
307
  {window.location.pathname.includes("enterprise") &&
310
308
  planState === "GRACE PERIOD" ? (
@@ -89,9 +89,9 @@ const ChatHeader = ({
89
89
  </div>
90
90
  </div>
91
91
 
92
- <span onClick={() => setChatOptions(!chatOptions)}>
92
+ {/* <span onClick={() => setChatOptions(!chatOptions)}>
93
93
  <MoreSvg style={{ color: "#636666" }} />
94
- </span>
94
+ </span> */}
95
95
 
96
96
  {/* {chatOptions && (
97
97
  <div className="more-options" ref={dropdownContainer}>
@@ -984,6 +984,7 @@ export const TextMessagePanel = styled.div`
984
984
  justify-content: center;
985
985
  border: none;
986
986
  outline: none;
987
+ cursor: pointer;
987
988
 
988
989
  &.disabled {
989
990
  background-color: #c6cccc !important;
@@ -206,11 +206,26 @@ const Messages = ({
206
206
  if (receiverID && courseID) {
207
207
  getMessages();
208
208
  }
209
- }, [receiverID, courseID]);
209
+ }, [receiverID, courseID, roomID]);
210
210
 
211
211
  useEffect(() => {
212
212
  if (createMessageData?.data) {
213
- getMessages(accountType, receiverID, courseID, roomID);
213
+ if (accountType === "enterprise") {
214
+ handleRoomMessage(accountType, receiverID, courseID);
215
+ handleRoomRecipientDetails(accountType, receiverID, courseID);
216
+ }
217
+ if (!affiliates && accountType === "instructor") {
218
+ handleRoomMessage(accountType, receiverID, courseID);
219
+ handleRoomRecipientDetails(accountType, receiverID, courseID);
220
+ }
221
+ if (affiliates && accountType === "instructor") {
222
+ handleRoomMessageAffiliate(receiverID, courseID, roomID);
223
+ handleRoomRecipientDetails(accountType, receiverID, courseID);
224
+ }
225
+ if (accountType === "personal") {
226
+ handleRetrieveMessage(receiverID, courseID, roomID);
227
+ handleRoomRecipientDetailsPersonal(receiverID, courseID);
228
+ }
214
229
  }
215
230
  }, [createMessageData?.data]);
216
231
 
@@ -311,11 +326,17 @@ const Messages = ({
311
326
  };
312
327
  }, [scrollRef]);
313
328
 
329
+ const messagesEndRef = useRef(null);
330
+ useEffect(() => {
331
+ messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
332
+ }, [allMessages]); // Run this effect whenever `allMessages` changes
333
+
334
+
314
335
  return (
315
336
  <>
316
337
  <MessagesWrapper>
317
338
  <div className="message_by_wrapper">
318
- <p className="mbw_name"> Message {user} </p>
339
+ <p className="mbw_name"> Message {userFullName} </p>
319
340
 
320
341
  <div className="icon-box">
321
342
  <span onClick={() => setIsFullHeight(!isFullHeight)}>
@@ -379,6 +400,8 @@ const Messages = ({
379
400
  lastMessage={lastMessage}
380
401
  />
381
402
  ))}
403
+ {/* Add a dummy div to scroll to */}
404
+ <div ref={messagesEndRef} />
382
405
  </>
383
406
  ))}
384
407
  </>