@ethora/chat-component-rn 26.7.5 → 26.7.7
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/CHANGELOG.md +62 -0
- package/README.md +31 -8
- package/lib/commonjs/assets/icons.js +7 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +26 -7
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +5 -2
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +36 -14
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +2 -0
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +7 -23
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +14 -13
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +208 -35
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +317 -98
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +320 -110
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +552 -213
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +226 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +6 -2
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js +8 -0
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +2 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +202 -104
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +8 -0
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +556 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +210 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +7 -21
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +507 -244
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +74 -46
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +9 -2
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +17 -7
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +80 -11
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledComponents.js +9 -3
- package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +32 -39
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/getChatBackground.js +23 -0
- package/lib/commonjs/helpers/getChatBackground.js.map +1 -0
- package/lib/commonjs/helpers/mediaLibraryRuntime.js +31 -0
- package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/commonjs/helpers/pickImageAsset.js +68 -0
- package/lib/commonjs/helpers/pickImageAsset.js.map +1 -0
- package/lib/commonjs/helpers/pushPayload.js +71 -0
- package/lib/commonjs/helpers/pushPayload.js.map +1 -0
- package/lib/commonjs/helpers/sheetGestures.js +32 -0
- package/lib/commonjs/helpers/sheetGestures.js.map +1 -0
- package/lib/commonjs/helpers/updateMessagesTillLast.js +12 -40
- package/lib/commonjs/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/commonjs/hooks/useChatRoomFocus.js +3 -9
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/commonjs/hooks/useLogout.js +0 -5
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/hooks/usePendingNotification.js +8 -11
- package/lib/commonjs/hooks/usePendingNotification.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +23 -50
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +121 -1
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +19 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +59 -0
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/authRefresh.js +12 -2
- package/lib/commonjs/networking/authRefresh.js.map +1 -1
- package/lib/commonjs/networking/outboundQueue.js +0 -18
- package/lib/commonjs/networking/outboundQueue.js.map +1 -1
- package/lib/commonjs/networking/stanzaHandlers.js +1 -10
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +8 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js +5 -1
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +62 -108
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +3 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +3 -22
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/commonjs/services/pushSubscriptionService.js +15 -13
- package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
- package/lib/module/assets/icons.js +6 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +26 -7
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +5 -2
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +36 -14
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +2 -0
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +8 -24
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +14 -13
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +207 -35
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +319 -101
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +311 -113
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +555 -217
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +223 -0
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +6 -2
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/Modal/Modal.js +9 -1
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js +2 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +205 -106
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +8 -0
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +548 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +205 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +9 -23
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +509 -248
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +76 -48
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +9 -2
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +17 -7
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +81 -12
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledComponents.js +9 -3
- package/lib/module/components/styled/StyledComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/context/xmppProvider.js +32 -39
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/getChatBackground.js +18 -0
- package/lib/module/helpers/getChatBackground.js.map +1 -0
- package/lib/module/helpers/mediaLibraryRuntime.js +25 -0
- package/lib/module/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/module/helpers/pickImageAsset.js +63 -0
- package/lib/module/helpers/pickImageAsset.js.map +1 -0
- package/lib/module/helpers/pushPayload.js +63 -0
- package/lib/module/helpers/pushPayload.js.map +1 -0
- package/lib/module/helpers/sheetGestures.js +26 -0
- package/lib/module/helpers/sheetGestures.js.map +1 -0
- package/lib/module/helpers/updateMessagesTillLast.js +13 -41
- package/lib/module/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/module/hooks/useChatRoomFocus.js +3 -9
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/module/hooks/useLogout.js +0 -5
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/hooks/usePendingNotification.js +8 -11
- package/lib/module/hooks/usePendingNotification.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +24 -51
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/i18n/strings.js +121 -1
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +2 -1
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/user.api.js +56 -0
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/authRefresh.js +12 -2
- package/lib/module/networking/authRefresh.js.map +1 -1
- package/lib/module/networking/outboundQueue.js +0 -17
- package/lib/module/networking/outboundQueue.js.map +1 -1
- package/lib/module/networking/stanzaHandlers.js +1 -10
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +8 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js +5 -1
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/module/networking/xmppClient.js +62 -108
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +3 -1
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +2 -20
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/services/pushSubscriptionService.js +15 -13
- package/lib/module/services/pushSubscriptionService.js.map +1 -1
- package/lib/typescript/assets/icons.d.ts +16 -0
- package/lib/typescript/assets/icons.d.ts.map +1 -1
- package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ProfileImagePlaceholder.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomList.d.ts +7 -0
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +3 -0
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +9 -0
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +10 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +9 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +1 -0
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts +4 -2
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/UpdNewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +75 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +1 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +25 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +1 -0
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +6 -1
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +16 -0
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +1 -0
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
- package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/getChatBackground.d.ts +15 -0
- package/lib/typescript/helpers/getChatBackground.d.ts.map +1 -0
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +3 -0
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/pickImageAsset.d.ts +27 -0
- package/lib/typescript/helpers/pickImageAsset.d.ts.map +1 -0
- package/lib/typescript/helpers/pushPayload.d.ts +7 -0
- package/lib/typescript/helpers/pushPayload.d.ts.map +1 -0
- package/lib/typescript/helpers/sheetGestures.d.ts +20 -0
- package/lib/typescript/helpers/sheetGestures.d.ts.map +1 -0
- package/lib/typescript/helpers/updateMessagesTillLast.d.ts.map +1 -1
- package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
- package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
- package/lib/typescript/hooks/usePendingNotification.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +3 -1
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/user.api.d.ts +27 -0
- package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
- package/lib/typescript/networking/authRefresh.d.ts +4 -1
- package/lib/typescript/networking/authRefresh.d.ts.map +1 -1
- package/lib/typescript/networking/outboundQueue.d.ts +0 -16
- package/lib/typescript/networking/outboundQueue.d.ts.map +1 -1
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/subscribeToRoomMessages.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +8 -33
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +1 -18
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/services/pushSubscriptionService.d.ts +1 -1
- package/lib/typescript/services/pushSubscriptionService.d.ts.map +1 -1
- package/lib/typescript/types/models/room.model.d.ts +0 -15
- package/lib/typescript/types/models/room.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +31 -20
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/assets/icons.tsx +48 -9
- package/src/components/Header/HeaderRoomList.tsx +24 -6
- package/src/components/MainComponents/ChatHeader.tsx +5 -2
- package/src/components/MainComponents/ChatRoom.tsx +38 -20
- package/src/components/MainComponents/ChatWrapper.tsx +3 -0
- package/src/components/MainComponents/MessageList.tsx +8 -24
- package/src/components/MainComponents/ProfileImagePlaceholder.tsx +21 -14
- package/src/components/MainComponents/RoomList.tsx +236 -39
- package/src/components/Menu/HeaderRoomListMenu.tsx +328 -75
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +331 -97
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +598 -279
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +244 -0
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +4 -2
- package/src/components/Modals/Modal/Modal.tsx +7 -0
- package/src/components/Modals/NewChatModal/ModalContent.tsx +6 -3
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +219 -117
- package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +12 -1
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +615 -0
- package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +217 -0
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +14 -4
- package/src/components/Modals/UserProfileModal/EditUserModal.tsx +9 -25
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +617 -307
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +75 -58
- package/src/components/Modals/styledModalComponents.tsx +9 -2
- package/src/components/RoomComponents/ChatRoomItem.tsx +14 -7
- package/src/components/styled/SendInput.tsx +83 -12
- package/src/components/styled/StyledComponents.ts +9 -3
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +11 -4
- package/src/context/xmppProvider.tsx +36 -47
- package/src/helpers/getChatBackground.ts +18 -0
- package/src/helpers/mediaLibraryRuntime.ts +25 -0
- package/src/helpers/pickImageAsset.ts +68 -0
- package/src/helpers/pushPayload.ts +62 -0
- package/src/helpers/sheetGestures.ts +25 -0
- package/src/helpers/updateMessagesTillLast.tsx +17 -42
- package/src/hooks/useChatRoomFocus.ts +3 -11
- package/src/hooks/useLogout.tsx +0 -7
- package/src/hooks/usePendingNotification.ts +5 -11
- package/src/hooks/useSendMessage.tsx +24 -60
- package/src/i18n/strings.ts +121 -1
- package/src/main.ts +4 -1
- package/src/networking/api-requests/user.api.ts +71 -0
- package/src/networking/authRefresh.ts +25 -4
- package/src/networking/outboundQueue.ts +0 -29
- package/src/networking/stanzaHandlers.ts +1 -9
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +6 -1
- package/src/networking/xmpp/subscribeToRoomMessages.xmpp.ts +12 -1
- package/src/networking/xmppClient.ts +65 -119
- package/src/roomStore/chatSettingsSlice.ts +3 -1
- package/src/roomStore/roomsSlice.ts +2 -20
- package/src/services/pushSubscriptionService.ts +18 -13
- package/src/types/models/room.model.ts +0 -15
- package/src/types/types.ts +33 -20
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import {
|
|
5
|
+
ActivityIndicator,
|
|
6
|
+
Modal,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
Text,
|
|
9
|
+
TextInput,
|
|
10
|
+
TouchableOpacity,
|
|
11
|
+
View,
|
|
12
|
+
} from 'react-native';
|
|
13
|
+
import { useSelector } from 'react-redux';
|
|
14
|
+
import { getActiveRoom, RootState } from '../../../roomStore';
|
|
15
|
+
import { postReportRoom } from '../../../networking/api-requests/rooms.api';
|
|
16
|
+
import { useToast } from '../../../context/ToastContext';
|
|
17
|
+
import { useT } from '../../../i18n/useT';
|
|
18
|
+
import { getIconColor } from '../../../helpers/getIconColor';
|
|
19
|
+
import { useChatSettingState } from '../../../hooks/useChatSettingState';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Category ids go to `POST /v1/chats/reports/{chatName}` as-is; the labels
|
|
23
|
+
* come from the i18n table, which already carried `report.category.*`
|
|
24
|
+
* strings in all six locales with nothing rendering them until now.
|
|
25
|
+
*/
|
|
26
|
+
const CATEGORIES = [
|
|
27
|
+
'spam',
|
|
28
|
+
'violence',
|
|
29
|
+
'childAbuse',
|
|
30
|
+
'pornography',
|
|
31
|
+
'personalDetails',
|
|
32
|
+
'illegalDrugs',
|
|
33
|
+
'other',
|
|
34
|
+
] as const;
|
|
35
|
+
|
|
36
|
+
interface ReportChatModalProps {
|
|
37
|
+
visible: boolean;
|
|
38
|
+
onClose: () => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const ReportChatModal: React.FC<ReportChatModalProps> = ({
|
|
42
|
+
visible,
|
|
43
|
+
onClose,
|
|
44
|
+
}) => {
|
|
45
|
+
const t = useT();
|
|
46
|
+
const { showToast } = useToast();
|
|
47
|
+
const { config } = useChatSettingState();
|
|
48
|
+
const activeRoom = useSelector((state: RootState) => getActiveRoom(state));
|
|
49
|
+
const [category, setCategory] = useState<string | null>(null);
|
|
50
|
+
const [details, setDetails] = useState('');
|
|
51
|
+
const [sending, setSending] = useState(false);
|
|
52
|
+
const primary = getIconColor(config);
|
|
53
|
+
|
|
54
|
+
const close = () => {
|
|
55
|
+
setCategory(null);
|
|
56
|
+
setDetails('');
|
|
57
|
+
onClose();
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const submit = async () => {
|
|
61
|
+
if (!category || sending) {return;}
|
|
62
|
+
setSending(true);
|
|
63
|
+
try {
|
|
64
|
+
await postReportRoom({
|
|
65
|
+
chatName: activeRoom?.jid?.split('@')[0] || '',
|
|
66
|
+
category,
|
|
67
|
+
text: details.trim() || undefined,
|
|
68
|
+
});
|
|
69
|
+
showToast({
|
|
70
|
+
id: Date.now().toString(),
|
|
71
|
+
title: 'Success',
|
|
72
|
+
message: t('modal.report.chatTitle'),
|
|
73
|
+
type: 'success',
|
|
74
|
+
});
|
|
75
|
+
close();
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error('Failed to report chat:', error);
|
|
78
|
+
showToast({
|
|
79
|
+
id: Date.now().toString(),
|
|
80
|
+
title: 'Error',
|
|
81
|
+
message: t('modal.report.chatTitle'),
|
|
82
|
+
type: 'error',
|
|
83
|
+
});
|
|
84
|
+
} finally {
|
|
85
|
+
setSending(false);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<Modal
|
|
91
|
+
transparent
|
|
92
|
+
visible={visible}
|
|
93
|
+
animationType="fade"
|
|
94
|
+
onRequestClose={close}
|
|
95
|
+
>
|
|
96
|
+
<View style={styles.backdrop}>
|
|
97
|
+
<TouchableOpacity
|
|
98
|
+
testID="report-backdrop"
|
|
99
|
+
style={StyleSheet.absoluteFill}
|
|
100
|
+
activeOpacity={1}
|
|
101
|
+
onPress={close}
|
|
102
|
+
/>
|
|
103
|
+
<View style={styles.card}>
|
|
104
|
+
<Text style={styles.title}>{t('modal.report.chatTitle')}</Text>
|
|
105
|
+
<View style={styles.categories}>
|
|
106
|
+
{CATEGORIES.map((id) => {
|
|
107
|
+
const selected = category === id;
|
|
108
|
+
return (
|
|
109
|
+
<TouchableOpacity
|
|
110
|
+
key={id}
|
|
111
|
+
testID={`report-category-${id}`}
|
|
112
|
+
activeOpacity={0.7}
|
|
113
|
+
onPress={() => setCategory(id)}
|
|
114
|
+
style={[
|
|
115
|
+
styles.category,
|
|
116
|
+
selected && { borderColor: primary, backgroundColor: primary + '14' },
|
|
117
|
+
]}
|
|
118
|
+
>
|
|
119
|
+
<Text
|
|
120
|
+
style={[styles.categoryLabel, selected && { color: primary }]}
|
|
121
|
+
>
|
|
122
|
+
{t(`report.category.${id}`)}
|
|
123
|
+
</Text>
|
|
124
|
+
</TouchableOpacity>
|
|
125
|
+
);
|
|
126
|
+
})}
|
|
127
|
+
</View>
|
|
128
|
+
{category === 'other' && (
|
|
129
|
+
<TextInput
|
|
130
|
+
testID="report-details"
|
|
131
|
+
style={styles.input}
|
|
132
|
+
placeholder={t('modal.report.otherDetails')}
|
|
133
|
+
placeholderTextColor="#8C8C8C"
|
|
134
|
+
value={details}
|
|
135
|
+
onChangeText={setDetails}
|
|
136
|
+
multiline
|
|
137
|
+
/>
|
|
138
|
+
)}
|
|
139
|
+
<View style={styles.buttons}>
|
|
140
|
+
<TouchableOpacity
|
|
141
|
+
activeOpacity={0.7}
|
|
142
|
+
style={[styles.button, styles.cancel]}
|
|
143
|
+
onPress={close}
|
|
144
|
+
>
|
|
145
|
+
<Text style={styles.cancelLabel}>{t('action.cancel')}</Text>
|
|
146
|
+
</TouchableOpacity>
|
|
147
|
+
<TouchableOpacity
|
|
148
|
+
testID="report-submit"
|
|
149
|
+
activeOpacity={0.7}
|
|
150
|
+
disabled={!category || sending}
|
|
151
|
+
style={[
|
|
152
|
+
styles.button,
|
|
153
|
+
{ backgroundColor: primary, opacity: !category || sending ? 0.5 : 1 },
|
|
154
|
+
]}
|
|
155
|
+
onPress={submit}
|
|
156
|
+
>
|
|
157
|
+
{sending ? (
|
|
158
|
+
<ActivityIndicator color="#FFFFFF" />
|
|
159
|
+
) : (
|
|
160
|
+
<Text style={styles.submitLabel}>{t('action.send')}</Text>
|
|
161
|
+
)}
|
|
162
|
+
</TouchableOpacity>
|
|
163
|
+
</View>
|
|
164
|
+
</View>
|
|
165
|
+
</View>
|
|
166
|
+
</Modal>
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const styles = StyleSheet.create({
|
|
171
|
+
backdrop: {
|
|
172
|
+
flex: 1,
|
|
173
|
+
backgroundColor: 'rgba(15,15,20,0.45)',
|
|
174
|
+
alignItems: 'center',
|
|
175
|
+
justifyContent: 'center',
|
|
176
|
+
padding: 24,
|
|
177
|
+
},
|
|
178
|
+
card: {
|
|
179
|
+
width: '100%',
|
|
180
|
+
borderRadius: 16,
|
|
181
|
+
backgroundColor: '#FFFFFF',
|
|
182
|
+
padding: 20,
|
|
183
|
+
},
|
|
184
|
+
title: {
|
|
185
|
+
fontSize: 18,
|
|
186
|
+
fontWeight: '600',
|
|
187
|
+
color: '#141414',
|
|
188
|
+
marginBottom: 16,
|
|
189
|
+
},
|
|
190
|
+
categories: {
|
|
191
|
+
flexDirection: 'row',
|
|
192
|
+
flexWrap: 'wrap',
|
|
193
|
+
gap: 8,
|
|
194
|
+
},
|
|
195
|
+
category: {
|
|
196
|
+
paddingHorizontal: 12,
|
|
197
|
+
paddingVertical: 8,
|
|
198
|
+
borderRadius: 20,
|
|
199
|
+
borderWidth: 1,
|
|
200
|
+
borderColor: '#E4E4E9',
|
|
201
|
+
},
|
|
202
|
+
categoryLabel: {
|
|
203
|
+
fontSize: 14,
|
|
204
|
+
color: '#141414',
|
|
205
|
+
},
|
|
206
|
+
input: {
|
|
207
|
+
marginTop: 16,
|
|
208
|
+
minHeight: 80,
|
|
209
|
+
borderRadius: 12,
|
|
210
|
+
borderWidth: 1,
|
|
211
|
+
borderColor: '#E4E4E9',
|
|
212
|
+
padding: 12,
|
|
213
|
+
fontSize: 14,
|
|
214
|
+
color: '#141414',
|
|
215
|
+
textAlignVertical: 'top',
|
|
216
|
+
},
|
|
217
|
+
buttons: {
|
|
218
|
+
flexDirection: 'row',
|
|
219
|
+
gap: 12,
|
|
220
|
+
marginTop: 20,
|
|
221
|
+
},
|
|
222
|
+
button: {
|
|
223
|
+
flex: 1,
|
|
224
|
+
height: 44,
|
|
225
|
+
borderRadius: 12,
|
|
226
|
+
alignItems: 'center',
|
|
227
|
+
justifyContent: 'center',
|
|
228
|
+
},
|
|
229
|
+
cancel: {
|
|
230
|
+
backgroundColor: '#F2F2F7',
|
|
231
|
+
},
|
|
232
|
+
cancelLabel: {
|
|
233
|
+
fontSize: 16,
|
|
234
|
+
fontWeight: '500',
|
|
235
|
+
color: '#141414',
|
|
236
|
+
},
|
|
237
|
+
submitLabel: {
|
|
238
|
+
fontSize: 16,
|
|
239
|
+
fontWeight: '600',
|
|
240
|
+
color: '#FFFFFF',
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
export default ReportChatModal;
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import { useVideoPlayer, VideoView } from 'expo-video';
|
|
27
27
|
import { PlayIcon } from '../../../assets/icons';
|
|
28
28
|
import * as FileSystem from 'expo-file-system/legacy';
|
|
29
|
-
import
|
|
29
|
+
import { getMediaLibrary } from '../../../helpers/mediaLibraryRuntime';
|
|
30
30
|
import { useToast } from '../../../context/ToastContext';
|
|
31
31
|
import PdfViewer from './PdfView';
|
|
32
32
|
import DocumentViewer from './DocumentViewer';
|
|
@@ -129,6 +129,8 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
129
129
|
if (!activeFile) {return null;}
|
|
130
130
|
|
|
131
131
|
const requestStoragePermission = async () => {
|
|
132
|
+
const MediaLibrary = getMediaLibrary();
|
|
133
|
+
if (!MediaLibrary?.requestPermissionsAsync) {return false;}
|
|
132
134
|
try {
|
|
133
135
|
const { status } = await MediaLibrary.requestPermissionsAsync();
|
|
134
136
|
return status === 'granted';
|
|
@@ -158,7 +160,7 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
158
160
|
const download = await FileSystem.downloadAsync(withFileToken(activeFile.fileURL), filePath);
|
|
159
161
|
|
|
160
162
|
if (download.status === 200) {
|
|
161
|
-
await
|
|
163
|
+
await getMediaLibrary()?.saveToLibraryAsync(download.uri);
|
|
162
164
|
showToast({
|
|
163
165
|
id: Date.now().toString(),
|
|
164
166
|
title: 'Success',
|
|
@@ -37,6 +37,13 @@ const Modal: React.FC<ModalProps> = ({ children, modal, setOpenModal }) => {
|
|
|
37
37
|
|
|
38
38
|
return <ModalComponent handleCloseModal={handleClose} />;
|
|
39
39
|
};
|
|
40
|
+
// Modals that present themselves (a real RN <Modal>, so the dim covers
|
|
41
|
+
// the whole window rather than stopping at this component's frame) must
|
|
42
|
+
// not also sit inside the shared in-tree backdrop — that would dim twice.
|
|
43
|
+
if (modal === MODAL_TYPES.NEW_CHAT) {
|
|
44
|
+
return <>{renderModalContent()}{children}</>;
|
|
45
|
+
}
|
|
46
|
+
|
|
40
47
|
return (
|
|
41
48
|
modal && (
|
|
42
49
|
<ModalBackground
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PickedImage } from '../../../helpers/pickImageAsset';
|
|
2
3
|
import {
|
|
3
4
|
ModalContainer,
|
|
4
5
|
CloseButton,
|
|
@@ -19,12 +20,13 @@ type ModalContentProps = {
|
|
|
19
20
|
roomName: string;
|
|
20
21
|
roomDescription: string;
|
|
21
22
|
chatType: ChatAccessOption;
|
|
22
|
-
profileImage: string |
|
|
23
|
+
profileImage: string | PickedImage | null;
|
|
23
24
|
setActiveTab: (tab: '0' | '1' | null) => void;
|
|
24
25
|
handleRoomNameChange: (e: string) => void;
|
|
25
26
|
setRoomDescription: (description: string) => void;
|
|
26
27
|
setChatType: (type: ChatAccessOption) => void;
|
|
27
|
-
setProfileImage: (image: string |
|
|
28
|
+
setProfileImage: (image: string | PickedImage | null) => void;
|
|
29
|
+
onUploadImage: () => void;
|
|
28
30
|
selectedUsers: any[];
|
|
29
31
|
setSelectedUsers: (users: any[]) => void;
|
|
30
32
|
handleCreateRoom: () => void;
|
|
@@ -40,6 +42,7 @@ const ModalContent: React.FC<ModalContentProps> = ({
|
|
|
40
42
|
roomDescription,
|
|
41
43
|
chatType,
|
|
42
44
|
profileImage,
|
|
45
|
+
onUploadImage,
|
|
43
46
|
setActiveTab,
|
|
44
47
|
handleRoomNameChange,
|
|
45
48
|
setChatType,
|
|
@@ -62,7 +65,7 @@ const ModalContent: React.FC<ModalContentProps> = ({
|
|
|
62
65
|
<ModalTitle>Create New Chat</ModalTitle>
|
|
63
66
|
<ProfileImagePlaceholder
|
|
64
67
|
size={120}
|
|
65
|
-
upload={{ active: true, onUpload:
|
|
68
|
+
upload={{ active: true, onUpload: onUploadImage }}
|
|
66
69
|
remove={{
|
|
67
70
|
enabled: true,
|
|
68
71
|
onRemoveClick: () => setProfileImage(null),
|