@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
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import React, { useState,
|
|
2
|
-
import
|
|
3
|
-
import { AddNewIcon, AddPhotoIcon } from '../../../assets/icons';
|
|
1
|
+
import React, { useState, useMemo } from 'react';
|
|
2
|
+
import { CameraIcon } from '../../../assets/icons';
|
|
4
3
|
import { RootState } from '../../../roomStore';
|
|
5
4
|
import { useXmppClient } from '../../../context/xmppProvider';
|
|
6
|
-
import {
|
|
7
|
-
CloseButton,
|
|
8
|
-
GroupContainer,
|
|
9
|
-
ModalBackground,
|
|
10
|
-
ModalContainer,
|
|
11
|
-
ModalTitle,
|
|
12
|
-
} from '../styledModalComponents';
|
|
13
5
|
import { addRoomViaApi, setCurrentRoom, updateRoom } from '../../../roomStore/roomsSlice';
|
|
14
|
-
import InputWithLabel from '../../styled/StyledInput';
|
|
15
6
|
import { uploadFile } from '../../../networking/api-requests/auth.api';
|
|
16
|
-
import {
|
|
17
|
-
|
|
7
|
+
import {
|
|
8
|
+
ActivityIndicator,
|
|
9
|
+
Alert,
|
|
10
|
+
Image,
|
|
11
|
+
Linking,
|
|
12
|
+
Modal,
|
|
13
|
+
Pressable,
|
|
14
|
+
StyleSheet,
|
|
15
|
+
Text,
|
|
16
|
+
TextInput,
|
|
17
|
+
TouchableOpacity,
|
|
18
|
+
View,
|
|
19
|
+
} from 'react-native';
|
|
20
|
+
import { getIconColor } from '../../../helpers/getIconColor';
|
|
21
|
+
import { useT } from '../../../i18n/useT';
|
|
18
22
|
import * as ImagePicker from 'expo-image-picker';
|
|
19
23
|
import { ApiRoom, ChatAccessOption, RoomMember } from '../../../types/models/room.model';
|
|
20
24
|
import { createRoomFromApi } from '../../../helpers/createRoomFromApi';
|
|
@@ -24,16 +28,16 @@ import { useChatSettingState } from '../../../hooks/useChatSettingState';
|
|
|
24
28
|
import { useToast } from '../../../context/ToastContext';
|
|
25
29
|
|
|
26
30
|
interface NewChatModalProps {
|
|
27
|
-
handleCloseModal?:
|
|
31
|
+
handleCloseModal?: () => void;
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
31
35
|
// Some call sites mount `<NewChatModal />` with no props (e.g. the
|
|
32
|
-
// empty-state in ChatRoom when roomsList is empty).
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
handleCloseModal: handleClose = () => {},
|
|
36
|
+
// empty-state in ChatRoom when roomsList is empty). There is nothing to
|
|
37
|
+
// dismiss back to there, so Cancel just resets the form.
|
|
38
|
+
handleCloseModal: handleClose,
|
|
36
39
|
}) => {
|
|
40
|
+
const t = useT();
|
|
37
41
|
const config = useAppSelector(
|
|
38
42
|
(state: RootState) => state.chatSettingStore.config
|
|
39
43
|
);
|
|
@@ -43,9 +47,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
|
43
47
|
const { user } = useChatSettingState();
|
|
44
48
|
const { showToast } = useToast();
|
|
45
49
|
|
|
46
|
-
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
|
47
50
|
const [loading, setLoading] = useState<boolean>(false);
|
|
48
|
-
const [activeTab, setActiveTab] = useState<'0' | '1' | null>('0');
|
|
49
51
|
|
|
50
52
|
const [roomName, setRoomName] = useState<string>('');
|
|
51
53
|
const [roomDescription, setRoomDescription] = useState<string>('');
|
|
@@ -65,7 +67,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
|
65
67
|
|
|
66
68
|
const validateRoomName = (name: string) => {
|
|
67
69
|
if (name.trim().length < 3) {
|
|
68
|
-
return '
|
|
70
|
+
return t('modal.newChat.nameTooShort');
|
|
69
71
|
}
|
|
70
72
|
return '';
|
|
71
73
|
};
|
|
@@ -97,13 +99,17 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
|
97
99
|
}));
|
|
98
100
|
};
|
|
99
101
|
|
|
100
|
-
const
|
|
101
|
-
const handleCloseModal = () => {
|
|
102
|
-
handleClose();
|
|
103
|
-
setActiveTab('0');
|
|
104
|
-
setIsModalOpen(false);
|
|
102
|
+
const resetForm = () => {
|
|
105
103
|
setRoomName('');
|
|
104
|
+
setRoomDescription('');
|
|
105
|
+
setProfileImage(null);
|
|
106
106
|
setSelectedUsers([]);
|
|
107
|
+
setErrors({ name: '', description: '' });
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const handleCloseModal = () => {
|
|
111
|
+
resetForm();
|
|
112
|
+
handleClose?.();
|
|
107
113
|
};
|
|
108
114
|
|
|
109
115
|
const onUpload = async () => {
|
|
@@ -129,7 +135,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
|
129
135
|
quality: 0.8,
|
|
130
136
|
});
|
|
131
137
|
|
|
132
|
-
if (result.canceled) return;
|
|
138
|
+
if (result.canceled) {return;}
|
|
133
139
|
|
|
134
140
|
const asset = result.assets[0];
|
|
135
141
|
const originalName = asset.uri.split('/').pop();
|
|
@@ -161,7 +167,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
|
161
167
|
usersArrayLength
|
|
162
168
|
);
|
|
163
169
|
|
|
164
|
-
if (!normalizedChat || !client) return;
|
|
170
|
+
if (!normalizedChat || !client) {return;}
|
|
165
171
|
|
|
166
172
|
dispatch(
|
|
167
173
|
addRoomViaApi({
|
|
@@ -261,103 +267,199 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
|
261
267
|
}
|
|
262
268
|
}
|
|
263
269
|
|
|
264
|
-
|
|
265
|
-
setErrors({ name: '', description: '' });
|
|
266
|
-
setProfileImage(null);
|
|
267
|
-
setRoomName('');
|
|
268
|
-
setRoomDescription('');
|
|
270
|
+
resetForm();
|
|
269
271
|
setLoading(false);
|
|
270
272
|
}
|
|
271
273
|
};
|
|
272
274
|
|
|
275
|
+
const primary = getIconColor(config);
|
|
276
|
+
const pickedUri =
|
|
277
|
+
profileImage && typeof profileImage === 'object' && 'uri' in profileImage
|
|
278
|
+
? profileImage.uri
|
|
279
|
+
: typeof profileImage === 'string'
|
|
280
|
+
? profileImage
|
|
281
|
+
: null;
|
|
282
|
+
|
|
273
283
|
return (
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
<
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
upload={{ active: true, onUpload }}
|
|
301
|
-
remove={{ enabled: true, onRemoveClick }}
|
|
302
|
-
placeholderIcon={<AddPhotoIcon color="#0052CD" />}
|
|
303
|
-
icon={
|
|
304
|
-
profileImage && typeof profileImage === 'object' && 'uri' in profileImage
|
|
305
|
-
? { uri: profileImage.uri }
|
|
306
|
-
: profileImage
|
|
307
|
-
}
|
|
308
|
-
disableOverlay={!profileImage}
|
|
309
|
-
role="user"
|
|
310
|
-
/>
|
|
311
|
-
<GroupContainer
|
|
312
|
-
style={{
|
|
313
|
-
flexDirection: 'column',
|
|
314
|
-
position: 'relative',
|
|
315
|
-
width: '100%',
|
|
316
|
-
}}
|
|
284
|
+
// A real <Modal> rather than an in-tree overlay: the SDK renders inside
|
|
285
|
+
// whatever frame the host gives it, so an in-tree backdrop stopped at
|
|
286
|
+
// the component's edge and left the host's own chrome (tab bars and
|
|
287
|
+
// such) lit. This one dims the whole window.
|
|
288
|
+
<Modal
|
|
289
|
+
transparent
|
|
290
|
+
visible
|
|
291
|
+
animationType="fade"
|
|
292
|
+
statusBarTranslucent
|
|
293
|
+
onRequestClose={handleCloseModal}
|
|
294
|
+
>
|
|
295
|
+
<View style={styles.backdrop}>
|
|
296
|
+
<Pressable
|
|
297
|
+
testID="new-chat-backdrop"
|
|
298
|
+
style={StyleSheet.absoluteFill}
|
|
299
|
+
onPress={handleCloseModal}
|
|
300
|
+
/>
|
|
301
|
+
<View style={styles.card}>
|
|
302
|
+
<Text style={styles.title}>{t('modal.newChat.title')}</Text>
|
|
303
|
+
|
|
304
|
+
<TouchableOpacity
|
|
305
|
+
testID="new-chat-picture"
|
|
306
|
+
activeOpacity={0.8}
|
|
307
|
+
onPress={onUpload}
|
|
308
|
+
onLongPress={pickedUri ? onRemoveClick : undefined}
|
|
309
|
+
style={[styles.picture, { backgroundColor: primary }]}
|
|
317
310
|
>
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
311
|
+
{pickedUri ? (
|
|
312
|
+
<Image source={{ uri: pickedUri }} style={styles.pictureImage} />
|
|
313
|
+
) : (
|
|
314
|
+
<CameraIcon color="#FFFFFF" width={26} height={26} />
|
|
315
|
+
)}
|
|
316
|
+
</TouchableOpacity>
|
|
317
|
+
|
|
318
|
+
<TextInput
|
|
319
|
+
testID="new-chat-name"
|
|
320
|
+
style={styles.input}
|
|
321
|
+
value={roomName}
|
|
322
|
+
onChangeText={handleRoomNameChange}
|
|
323
|
+
placeholder={t('modal.newChat.roomNamePlaceholder')}
|
|
324
|
+
placeholderTextColor="#8C8C8C"
|
|
325
|
+
returnKeyType="next"
|
|
326
|
+
/>
|
|
327
|
+
{!!errors.name && roomName.length > 0 && (
|
|
328
|
+
<Text testID="new-chat-name-error" style={styles.error}>
|
|
329
|
+
{errors.name}
|
|
330
|
+
</Text>
|
|
331
|
+
)}
|
|
332
|
+
|
|
333
|
+
<TextInput
|
|
334
|
+
testID="new-chat-description"
|
|
335
|
+
style={[styles.input, styles.textArea]}
|
|
336
|
+
value={roomDescription}
|
|
337
|
+
onChangeText={handleRoomDescriptionChange}
|
|
338
|
+
placeholder={t('modal.newChat.descriptionPlaceholder')}
|
|
339
|
+
placeholderTextColor="#8C8C8C"
|
|
340
|
+
multiline
|
|
341
|
+
/>
|
|
342
|
+
|
|
343
|
+
<View style={styles.buttons}>
|
|
344
|
+
<TouchableOpacity
|
|
345
|
+
testID="new-chat-cancel"
|
|
346
|
+
activeOpacity={0.7}
|
|
347
|
+
style={[styles.button, styles.cancel]}
|
|
349
348
|
onPress={handleCloseModal}
|
|
350
|
-
|
|
351
|
-
style={{
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
349
|
+
>
|
|
350
|
+
<Text style={styles.cancelLabel}>{t('action.cancel')}</Text>
|
|
351
|
+
</TouchableOpacity>
|
|
352
|
+
<TouchableOpacity
|
|
353
|
+
testID="new-chat-submit"
|
|
354
|
+
activeOpacity={0.7}
|
|
355
|
+
disabled={!isValid || loading}
|
|
356
|
+
style={[
|
|
357
|
+
styles.button,
|
|
358
|
+
{ backgroundColor: primary, opacity: !isValid || loading ? 0.5 : 1 },
|
|
359
|
+
]}
|
|
360
|
+
onPress={handleCreateRoom}
|
|
361
|
+
>
|
|
362
|
+
{loading ? (
|
|
363
|
+
<ActivityIndicator color="#FFFFFF" />
|
|
364
|
+
) : (
|
|
365
|
+
<Text style={styles.submitLabel}>
|
|
366
|
+
{t('modal.newChat.createButton')}
|
|
367
|
+
</Text>
|
|
368
|
+
)}
|
|
369
|
+
</TouchableOpacity>
|
|
370
|
+
</View>
|
|
371
|
+
</View>
|
|
372
|
+
</View>
|
|
373
|
+
</Modal>
|
|
360
374
|
);
|
|
361
375
|
};
|
|
362
376
|
|
|
377
|
+
const styles = StyleSheet.create({
|
|
378
|
+
backdrop: {
|
|
379
|
+
flex: 1,
|
|
380
|
+
// Opaque, per the design: the chat list behind stays hidden rather
|
|
381
|
+
// than showing through a translucent dim.
|
|
382
|
+
backgroundColor: '#E9EDF2',
|
|
383
|
+
alignItems: 'center',
|
|
384
|
+
justifyContent: 'center',
|
|
385
|
+
padding: 24,
|
|
386
|
+
},
|
|
387
|
+
card: {
|
|
388
|
+
width: '100%',
|
|
389
|
+
maxWidth: 380,
|
|
390
|
+
borderRadius: 20,
|
|
391
|
+
backgroundColor: '#FFFFFF',
|
|
392
|
+
padding: 20,
|
|
393
|
+
shadowColor: '#121219',
|
|
394
|
+
shadowOffset: { width: 0, height: 8 },
|
|
395
|
+
shadowOpacity: 0.08,
|
|
396
|
+
shadowRadius: 24,
|
|
397
|
+
elevation: 6,
|
|
398
|
+
},
|
|
399
|
+
title: {
|
|
400
|
+
fontSize: 17,
|
|
401
|
+
fontWeight: '700',
|
|
402
|
+
color: '#141414',
|
|
403
|
+
textAlign: 'center',
|
|
404
|
+
},
|
|
405
|
+
picture: {
|
|
406
|
+
alignSelf: 'center',
|
|
407
|
+
width: 72,
|
|
408
|
+
height: 72,
|
|
409
|
+
borderRadius: 36,
|
|
410
|
+
marginVertical: 18,
|
|
411
|
+
alignItems: 'center',
|
|
412
|
+
justifyContent: 'center',
|
|
413
|
+
overflow: 'hidden',
|
|
414
|
+
},
|
|
415
|
+
pictureImage: {
|
|
416
|
+
width: '100%',
|
|
417
|
+
height: '100%',
|
|
418
|
+
},
|
|
419
|
+
input: {
|
|
420
|
+
borderRadius: 12,
|
|
421
|
+
backgroundColor: '#F4F5F7',
|
|
422
|
+
paddingHorizontal: 14,
|
|
423
|
+
paddingVertical: 12,
|
|
424
|
+
fontSize: 15,
|
|
425
|
+
color: '#141414',
|
|
426
|
+
marginTop: 10,
|
|
427
|
+
},
|
|
428
|
+
textArea: {
|
|
429
|
+
minHeight: 84,
|
|
430
|
+
textAlignVertical: 'top',
|
|
431
|
+
},
|
|
432
|
+
error: {
|
|
433
|
+
color: '#E53935',
|
|
434
|
+
fontSize: 12,
|
|
435
|
+
marginTop: 6,
|
|
436
|
+
marginLeft: 4,
|
|
437
|
+
},
|
|
438
|
+
buttons: {
|
|
439
|
+
flexDirection: 'row',
|
|
440
|
+
gap: 12,
|
|
441
|
+
marginTop: 20,
|
|
442
|
+
},
|
|
443
|
+
button: {
|
|
444
|
+
flex: 1,
|
|
445
|
+
height: 44,
|
|
446
|
+
borderRadius: 12,
|
|
447
|
+
alignItems: 'center',
|
|
448
|
+
justifyContent: 'center',
|
|
449
|
+
},
|
|
450
|
+
cancel: {
|
|
451
|
+
backgroundColor: '#E7E8EA',
|
|
452
|
+
},
|
|
453
|
+
cancelLabel: {
|
|
454
|
+
fontSize: 15,
|
|
455
|
+
fontWeight: '500',
|
|
456
|
+
color: '#8C8C8C',
|
|
457
|
+
},
|
|
458
|
+
submitLabel: {
|
|
459
|
+
fontSize: 15,
|
|
460
|
+
fontWeight: '600',
|
|
461
|
+
color: '#FFFFFF',
|
|
462
|
+
},
|
|
463
|
+
});
|
|
464
|
+
|
|
363
465
|
export default NewChatModal;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useMemo } from 'react';
|
|
2
|
+
import { pickImageAsset, PickedImage } from '../../../helpers/pickImageAsset';
|
|
2
3
|
import Button from '../../styled/Button';
|
|
3
4
|
import { AddNewIcon } from '../../../assets/icons';
|
|
4
5
|
import { useDispatch, useSelector } from 'react-redux';
|
|
@@ -29,7 +30,16 @@ const NewChatModal: React.FC = () => {
|
|
|
29
30
|
name: 'Public',
|
|
30
31
|
id: 'public',
|
|
31
32
|
});
|
|
32
|
-
const [profileImage, setProfileImage] = useState<
|
|
33
|
+
const [profileImage, setProfileImage] = useState<
|
|
34
|
+
string | PickedImage | null
|
|
35
|
+
>(null);
|
|
36
|
+
|
|
37
|
+
const handleUploadImage = async () => {
|
|
38
|
+
const picked = await pickImageAsset();
|
|
39
|
+
if (picked) {
|
|
40
|
+
setProfileImage(picked);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
33
43
|
const [errors, setErrors] = useState({ name: '', description: '' });
|
|
34
44
|
const [selectedUsers, setSelectedUsers] = useState<RoomMember[]>([]);
|
|
35
45
|
|
|
@@ -119,6 +129,7 @@ const NewChatModal: React.FC = () => {
|
|
|
119
129
|
setRoomDescription={setRoomDescription}
|
|
120
130
|
setChatType={setChatType}
|
|
121
131
|
setProfileImage={setProfileImage}
|
|
132
|
+
onUploadImage={handleUploadImage}
|
|
122
133
|
selectedUsers={selectedUsers}
|
|
123
134
|
setSelectedUsers={setSelectedUsers}
|
|
124
135
|
handleCreateRoom={handleCreateRoom}
|