@esvndev/es-react-template-chat 0.0.14 → 0.0.16

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/dist/index.mjs CHANGED
@@ -20445,24 +20445,152 @@ var dayjs_min = {exports: {}};
20445
20445
  !function(t,n){module.exports=n(dayjs_min.exports);}(commonjsGlobal,(function(t){function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var h=n(t),_={name:"vi",weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),weekStart:1,weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"}};return h.default.locale(_,null,!0),_}));
20446
20446
  }(vi));
20447
20447
 
20448
+ //import * as chatStore from '../store'
20449
+ const useChat = () => {
20450
+ //const dispatch = useAppDispatch()
20451
+ const { active, checkInit, chatRoomId, userLogin, listContact, contactId, typeChat, loadChat, messageByGroup, listHistory, listChatType, archiveStore, checkScroll, listGeneralGroup, pinnedMessages, typingUsers } = useAppSelector((state) => state.chat);
20452
+ console.log('active', active);
20453
+ // const getHistoryApi = (params: any) => {
20454
+ // return dispatch(chatStore.get_history(params))
20455
+ // }
20456
+ // const get_message_by_group_cursor_api = (params: any) => {
20457
+ // return dispatch(chatStore.get_message_by_group_cursor(params))
20458
+ // }
20459
+ // const getHistoryActiveApi = (params: any) => {
20460
+ // return dispatch(chatStore.get_history_active(params))
20461
+ // }
20462
+ // const getInfoApi = (params: any) => {
20463
+ // return dispatch(chatStore.get_info(params))
20464
+ // }
20465
+ // const getMessageByGroupApi = (params: any, paging: any) => {
20466
+ // return dispatch(chatStore.get_message_by_group({ chatRoomId: params, paging }))
20467
+ // }
20468
+ // const getMessageByContactApi = (params: string, paging: any) => {
20469
+ // return dispatch(chatStore.get_message_by_contact({ chatRoomId: params, paging }))
20470
+ // }
20471
+ // const groupsApi = (params: any) => {
20472
+ // return dispatch(chatStore.groups(params))
20473
+ // }
20474
+ // const addMemberGroup = (params: any) => {
20475
+ // return dispatch(chatStore.addMemberGroup(params))
20476
+ // }
20477
+ // const senMessageApi = (id: string, params: any) => {
20478
+ // return dispatch(chatStore.sen_message({ id, formData: params }))
20479
+ // }
20480
+ // const deleteMessageApi = (params: any) => {
20481
+ // return dispatch(chatStore.delete_message(params))
20482
+ // }
20483
+ // const recallMessageApi = (params: any) => {
20484
+ // return dispatch(chatStore.recall_message(params))
20485
+ // }
20486
+ // const contactAddApi = (params: any) => {
20487
+ // return dispatch(chatStore.contact_add(params))
20488
+ // }
20489
+ // const updateGroupAvatarApi = (params: any) => {
20490
+ // return dispatch(chatStore.update_group_avatar(params))
20491
+ // }
20492
+ // const getProfileApi = () => {
20493
+ // return dispatch(chatStore.get_profile())
20494
+ // }
20495
+ // const getUsersApi = (params: any) => {
20496
+ // return dispatch(chatStore.get_users(params))
20497
+ // }
20498
+ // const getContactApi = (params: any) => {
20499
+ // return dispatch(chatStore.get_contact(params))
20500
+ // }
20501
+ // const updateChatRoomMemberApi = (params: any) => {
20502
+ // return dispatch(chatStore.update_chat_room_member(params))
20503
+ // }
20504
+ // const setScroll = (params: any) => {
20505
+ // return dispatch(chatStore.setScroll(params))
20506
+ // }
20507
+ // const setGeneralGroup = (params: any) => {
20508
+ // return dispatch(chatStore.setGeneralGroup(params))
20509
+ // }
20510
+ // const getPagingEmployeeApi = (params: any) => {
20511
+ // return dispatch(chatStore.getPagingEmployeeApi(params))
20512
+ // }
20513
+ // const connectChatRoomMember = (params: any) => {
20514
+ // return dispatch(chatStore.connectChatRoomMemberApi(params))
20515
+ // }
20516
+ // const pinMessageChatRoom = (params: any) => {
20517
+ // return dispatch(chatStore.pinMessageChatRoomApi(params))
20518
+ // }
20519
+ // const getPinMessageChatRoomApi = (params: any) => {
20520
+ // return dispatch(chatStore.getPinMessageChatRoomApi(params))
20521
+ // }
20522
+ // const deletePinMessage = (pinId: string) => {
20523
+ // return dispatch(chatStore.deletePinMessageApi(pinId))
20524
+ // }
20525
+ // const updateGroupTagApi = (params: any) => {
20526
+ // return dispatch(chatStore.updateGroupTagApi(params))
20527
+ // }
20528
+ // const createReminderApi = (params: any) => {
20529
+ // return dispatch(chatStore.createReminderApi(params))
20530
+ // }
20531
+ return {
20532
+ active,
20533
+ contactId,
20534
+ typeChat,
20535
+ chatRoomId,
20536
+ checkInit,
20537
+ userLogin,
20538
+ listContact,
20539
+ loadChat,
20540
+ messageByGroup,
20541
+ listHistory,
20542
+ listChatType,
20543
+ pinnedMessages,
20544
+ archiveStore,
20545
+ checkScroll,
20546
+ listGeneralGroup,
20547
+ // getHistoryApi,
20548
+ // getInfoApi,
20549
+ // getMessageByGroupApi,
20550
+ // getMessageByContactApi,
20551
+ // groupsApi,
20552
+ // addMemberGroup,
20553
+ // senMessageApi,
20554
+ // deleteMessageApi,
20555
+ // recallMessageApi,
20556
+ // contactAddApi,
20557
+ // updateGroupAvatarApi,
20558
+ // getProfileApi,
20559
+ // getUsersApi,
20560
+ // getContactApi,
20561
+ // getHistoryActiveApi,
20562
+ // updateChatRoomMemberApi,
20563
+ // setScroll,
20564
+ // setGeneralGroup,
20565
+ // get_message_by_group_cursor_api,
20566
+ // getPagingEmployeeApi,
20567
+ // connectChatRoomMember,
20568
+ // pinMessageChatRoom,
20569
+ // getPinMessageChatRoomApi,
20570
+ // deletePinMessage,
20571
+ // updateGroupTagApi,
20572
+ // createReminderApi,
20573
+ typingUsers
20574
+ };
20575
+ };
20576
+
20448
20577
  const AppChat = () => {
20449
- // const {
20450
- // active,
20451
- // // contactId,
20452
- // // typeChat,
20453
- // // chatRoomId,
20454
- // // messageByGroup,
20455
- // // listHistory,
20456
- // // checkInit,
20457
- // // setScroll,
20458
- // // getHistoryApi,
20459
- // // getProfileApi,
20460
- // // getInfoApi,
20461
- // // getContactApi,
20462
- // // senMessageApi
20463
- // } = useChat()
20578
+ const { active,
20579
+ // contactId,
20580
+ // typeChat,
20581
+ // chatRoomId,
20582
+ // messageByGroup,
20583
+ // listHistory,
20584
+ // checkInit,
20585
+ // setScroll,
20586
+ // getHistoryApi,
20587
+ // getProfileApi,
20588
+ // getInfoApi,
20589
+ // getContactApi,
20590
+ // senMessageApi
20591
+ } = useChat();
20464
20592
  const { connection } = useAppSelector((state) => state.hubNotification);
20465
- //console.log('active', active)
20593
+ console.log('active', active);
20466
20594
  console.log('connection', connection);
20467
20595
  // const getWindowSize = () => {
20468
20596
  // const {innerWidth, innerHeight} = window