@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,5 +1,6 @@
|
|
|
1
1
|
/** @format */
|
|
2
2
|
|
|
3
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
3
4
|
import React, { FC, useMemo } from 'react';
|
|
4
5
|
import { View, StyleSheet, Image, Text } from 'react-native';
|
|
5
6
|
import { ProfileImagePlaceholder } from '../MainComponents/ProfileImagePlaceholder';
|
|
@@ -13,6 +14,8 @@ interface HeaderRoomListProps {
|
|
|
13
14
|
|
|
14
15
|
export const HeaderRoomList: FC<HeaderRoomListProps> = ({ setDrawerOpen }) => {
|
|
15
16
|
const { config, user, selectedUser } = useChatSettingState();
|
|
17
|
+
const insets = useSafeAreaInsets();
|
|
18
|
+
const topInset = config?.headerLayout?.safeAreaTop ? insets.top : 0;
|
|
16
19
|
|
|
17
20
|
const modalUser: any = selectedUser ?? user;
|
|
18
21
|
|
|
@@ -34,15 +37,20 @@ export const HeaderRoomList: FC<HeaderRoomListProps> = ({ setDrawerOpen }) => {
|
|
|
34
37
|
}, [config?.backgroundChat?.image]);
|
|
35
38
|
|
|
36
39
|
return (
|
|
37
|
-
<View style={styles.headerContainer}>
|
|
40
|
+
<View style={[styles.headerContainer, topInset ? { paddingTop: 16 + topInset } : null]}>
|
|
38
41
|
{!config?.disableRoomMenu && config?.headerMenu ? (
|
|
39
42
|
<View style={styles.leftContainer}>
|
|
40
43
|
<Button
|
|
44
|
+
testID="room-list-burger"
|
|
41
45
|
style={styles.menuButton}
|
|
42
46
|
color="black"
|
|
43
47
|
unstyled
|
|
44
48
|
EndIcon={<BurgerMenuIcon color={config?.colors?.primary} />}
|
|
45
|
-
onPress={() =>
|
|
49
|
+
onPress={() =>
|
|
50
|
+
typeof config?.headerMenu === 'function'
|
|
51
|
+
? config.headerMenu()
|
|
52
|
+
: setDrawerOpen()
|
|
53
|
+
}
|
|
46
54
|
/>
|
|
47
55
|
</View>
|
|
48
56
|
) : (
|
|
@@ -59,7 +67,7 @@ export const HeaderRoomList: FC<HeaderRoomListProps> = ({ setDrawerOpen }) => {
|
|
|
59
67
|
<ProfileImagePlaceholder
|
|
60
68
|
icon={modalUser?.profileImage ?? null}
|
|
61
69
|
name={modalUser?.name ?? modalUser?.firstName}
|
|
62
|
-
size={
|
|
70
|
+
size={36}
|
|
63
71
|
click={{
|
|
64
72
|
isClick: true,
|
|
65
73
|
onPress: setDrawerOpen,
|
|
@@ -76,9 +84,19 @@ const styles = StyleSheet.create({
|
|
|
76
84
|
alignItems: 'center',
|
|
77
85
|
paddingHorizontal: 16,
|
|
78
86
|
paddingTop: 16,
|
|
79
|
-
paddingBottom:
|
|
87
|
+
paddingBottom: 12,
|
|
80
88
|
minHeight: 56,
|
|
81
89
|
justifyContent: 'space-between',
|
|
90
|
+
backgroundColor: '#FFFFFF',
|
|
91
|
+
borderBottomLeftRadius: 20,
|
|
92
|
+
borderBottomRightRadius: 20,
|
|
93
|
+
// Lifts the header off the page ground behind it.
|
|
94
|
+
shadowColor: '#101828',
|
|
95
|
+
shadowOffset: { width: 0, height: 4 },
|
|
96
|
+
shadowOpacity: 0.06,
|
|
97
|
+
shadowRadius: 12,
|
|
98
|
+
elevation: 4,
|
|
99
|
+
zIndex: 2,
|
|
82
100
|
},
|
|
83
101
|
menuButton: {
|
|
84
102
|
padding: 8,
|
|
@@ -86,7 +104,7 @@ const styles = StyleSheet.create({
|
|
|
86
104
|
backgroundColor: 'transparent',
|
|
87
105
|
},
|
|
88
106
|
leftContainer: {
|
|
89
|
-
width:
|
|
107
|
+
width: 44,
|
|
90
108
|
alignItems: 'flex-start',
|
|
91
109
|
justifyContent: 'center',
|
|
92
110
|
},
|
|
@@ -98,7 +116,7 @@ const styles = StyleSheet.create({
|
|
|
98
116
|
justifyContent: 'center',
|
|
99
117
|
},
|
|
100
118
|
rightContainer: {
|
|
101
|
-
width:
|
|
119
|
+
width: 44,
|
|
102
120
|
alignItems: 'flex-end',
|
|
103
121
|
justifyContent: 'center',
|
|
104
122
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @format */
|
|
2
2
|
|
|
3
3
|
import React, { useCallback } from 'react';
|
|
4
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
5
|
import {
|
|
5
6
|
CenterContainer,
|
|
6
7
|
ChatContainerHeader,
|
|
@@ -87,12 +88,14 @@ const ChatHeader: React.FC<ChatHeaderProps> = ({
|
|
|
87
88
|
// here so `height` defines the band exactly (content centers via the
|
|
88
89
|
// styled `align-items: center`); the styled 12px vertical padding would
|
|
89
90
|
// otherwise add on top of it.
|
|
90
|
-
const
|
|
91
|
+
const insets = useSafeAreaInsets();
|
|
92
|
+
const topInset = config?.headerLayout?.safeAreaTop ? insets.top : 0;
|
|
93
|
+
const headerHeight = resolveHeaderHeight(config?.headerLayout?.height) + topInset;
|
|
91
94
|
|
|
92
95
|
return (
|
|
93
96
|
<>
|
|
94
97
|
<ChatContainerHeader
|
|
95
|
-
style={{ height: headerHeight, paddingTop:
|
|
98
|
+
style={{ height: headerHeight, paddingTop: topInset, paddingBottom: 0 }}
|
|
96
99
|
>
|
|
97
100
|
{handleBackClick && !config?.headerChatMenu ? (
|
|
98
101
|
<View style={styles.leftContainer}>
|
|
@@ -20,6 +20,7 @@ import NewChatModal from '../Modals/NewChatModal/NewChatModal';
|
|
|
20
20
|
import { EditWrapper } from './EditWrapper';
|
|
21
21
|
import { EmptyChatIllustration } from '../../assets/EmptyChatIllustration';
|
|
22
22
|
import { getIconColor } from '../../helpers/getIconColor';
|
|
23
|
+
import { getChatBackgroundColor } from '../../helpers/getChatBackground';
|
|
23
24
|
import { ChooseChatMessage } from './ChooseChatMessage';
|
|
24
25
|
import { useRoomUrl } from '../../hooks/useRoomUrl';
|
|
25
26
|
import { useSendMessage } from '../../hooks/useSendMessage';
|
|
@@ -215,30 +216,25 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
215
216
|
// Tracks what the user actually saw: `null` while they're at the
|
|
216
217
|
// bottom (safe to mark everything read), or the timestamp of the
|
|
217
218
|
// newest message visible when they scrolled away from it. Reported
|
|
218
|
-
//
|
|
219
|
+
// by MessageList via onReadBoundaryChange. Without this, leaving a
|
|
219
220
|
// room (or backgrounding) while scrolled up stamped `now()` as read
|
|
220
221
|
// and silently discarded genuinely-unread messages. Customer-
|
|
221
222
|
// reported #33.
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
const getReadBoundary = useCallback(
|
|
227
|
-
(jid: string): number | null =>
|
|
228
|
-
store.getState().rooms?.rooms?.[jid]?.readBoundaryTs ?? null,
|
|
229
|
-
[]
|
|
230
|
-
);
|
|
223
|
+
const readBoundaryRef = useRef<number | null>(null);
|
|
224
|
+
const handleReadBoundaryChange = useCallback((boundaryTs: number | null) => {
|
|
225
|
+
readBoundaryRef.current = boundaryTs;
|
|
226
|
+
}, []);
|
|
231
227
|
|
|
232
228
|
useEffect(() => {
|
|
233
229
|
if (!activeRoomJID) {
|
|
234
230
|
return;
|
|
235
231
|
}
|
|
236
232
|
|
|
233
|
+
readBoundaryRef.current = null;
|
|
237
234
|
dispatch(setVisibleRoom({ roomJID: activeRoomJID }));
|
|
238
235
|
setIsLoadingMore(false);
|
|
239
236
|
return () => {
|
|
240
|
-
const
|
|
241
|
-
const timestamp = boundaryTs ?? new Date().getTime();
|
|
237
|
+
const timestamp = readBoundaryRef.current ?? new Date().getTime();
|
|
242
238
|
dispatch(
|
|
243
239
|
setLastViewedTimestamp({
|
|
244
240
|
chatJID: activeRoomJID,
|
|
@@ -256,7 +252,7 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
256
252
|
// room, so messages the user never scrolled down to come
|
|
257
253
|
// back as read on the next login — the local count was
|
|
258
254
|
// right but the server overrode it.
|
|
259
|
-
visibleRoomTs:
|
|
255
|
+
visibleRoomTs: readBoundaryRef.current,
|
|
260
256
|
})
|
|
261
257
|
.catch(() => {});
|
|
262
258
|
}
|
|
@@ -345,7 +341,20 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
345
341
|
? KeyboardStickyView
|
|
346
342
|
: View;
|
|
347
343
|
const inputDockProps: any = {
|
|
348
|
-
|
|
344
|
+
// The dock carries the composer's white surface all the way to the
|
|
345
|
+
// bottom edge, so it needs the same rounded top and upward shadow —
|
|
346
|
+
// a square white block behind a rounded composer just hid the corners.
|
|
347
|
+
style: {
|
|
348
|
+
paddingBottom: inputDockPaddingBottom,
|
|
349
|
+
backgroundColor: '#fff',
|
|
350
|
+
borderTopLeftRadius: 20,
|
|
351
|
+
borderTopRightRadius: 20,
|
|
352
|
+
shadowColor: '#101828',
|
|
353
|
+
shadowOffset: { width: 0, height: -4 },
|
|
354
|
+
shadowOpacity: 0.06,
|
|
355
|
+
shadowRadius: 12,
|
|
356
|
+
elevation: 8,
|
|
357
|
+
},
|
|
349
358
|
...(stickyInput
|
|
350
359
|
? { offset: { closed: 0, opened: keyboardVerticalOffset } }
|
|
351
360
|
: {}),
|
|
@@ -354,11 +363,15 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
354
363
|
return (
|
|
355
364
|
<KeyboardWrapper {...keyboardWrapperProps}>
|
|
356
365
|
<ChatContainer
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
366
|
+
// The conversation's own colour, not white: the header's rounded
|
|
367
|
+
// bottom corners and the composer's rounded top corners reveal
|
|
368
|
+
// THIS view, so a white parent made both look square.
|
|
369
|
+
style={[
|
|
370
|
+
{ backgroundColor: getChatBackgroundColor(configWithEventHandlers) },
|
|
371
|
+
configWithEventHandlers?.chatRoomStyles as
|
|
372
|
+
| import('react-native').ViewStyle
|
|
373
|
+
| undefined,
|
|
374
|
+
]}
|
|
362
375
|
>
|
|
363
376
|
{!configWithEventHandlers?.disableHeader && (
|
|
364
377
|
<ChatHeader
|
|
@@ -397,7 +410,11 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
397
410
|
flex: 1,
|
|
398
411
|
justifyContent: 'center',
|
|
399
412
|
alignItems: 'center',
|
|
400
|
-
|
|
413
|
+
// Empty rooms used to flip to white, which broke the
|
|
414
|
+
// header's rounded corners in exactly the same way.
|
|
415
|
+
backgroundColor: getChatBackgroundColor(
|
|
416
|
+
configWithEventHandlers
|
|
417
|
+
),
|
|
401
418
|
}}
|
|
402
419
|
>
|
|
403
420
|
<NoMessagesPlaceholder />
|
|
@@ -470,6 +487,7 @@ const ChatRoom: React.FC<ChatRoomProps> = React.memo(
|
|
|
470
487
|
config={configWithEventHandlers}
|
|
471
488
|
loading={isLoadingMore}
|
|
472
489
|
isReply={false}
|
|
490
|
+
onReadBoundaryChange={handleReadBoundaryChange}
|
|
473
491
|
/>
|
|
474
492
|
)}
|
|
475
493
|
</View>
|
|
@@ -30,6 +30,7 @@ import Modal from '../Modals/Modal/Modal';
|
|
|
30
30
|
import ThreadWrapper from '../Thread/ThreadWrapper';
|
|
31
31
|
import {ModalWrapper} from '../Modals/ModalWrapper/ModalWrapper';
|
|
32
32
|
import {useChatSettingState} from '../../hooks/useChatSettingState';
|
|
33
|
+
import { usePendingNotification } from '../../hooks/usePendingNotification';
|
|
33
34
|
import {DeviceEventEmitter, Pressable, Text, View} from 'react-native';
|
|
34
35
|
import {pushLog as devPushLog} from '../../utils/devLogger';
|
|
35
36
|
import {normalizeRoomJid} from '../../helpers/normalizeRoomJid';
|
|
@@ -61,6 +62,8 @@ const ChatWrapper: FC<ChatWrapperProps> = ({
|
|
|
61
62
|
client: storedClient,
|
|
62
63
|
} = useChatSettingState();
|
|
63
64
|
|
|
65
|
+
usePendingNotification();
|
|
66
|
+
|
|
64
67
|
const [isInited, setInited] = useState(false);
|
|
65
68
|
const [showModal, setShowModal] = useState(false);
|
|
66
69
|
const [errorMsg, setErrorMsg] = useState<string | null>(null);
|
|
@@ -18,9 +18,8 @@ import {
|
|
|
18
18
|
TouchableOpacity,
|
|
19
19
|
ImageSourcePropType,
|
|
20
20
|
} from 'react-native';
|
|
21
|
-
import { useDispatch } from 'react-redux';
|
|
22
21
|
import { IMessage, User, IConfig, IRoom } from '../../types/types';
|
|
23
|
-
import { msgSortableMs
|
|
22
|
+
import { msgSortableMs } from '../../roomStore/roomsSlice';
|
|
24
23
|
import Composing from '../styled/StyledInputComponents/Composing';
|
|
25
24
|
import TreadLabel from '../styled/TreadLabel';
|
|
26
25
|
import { MessageContainer } from './MessageContainer';
|
|
@@ -29,6 +28,7 @@ import Loader from '../styled/Loader';
|
|
|
29
28
|
import { ArowDownIcon } from '../../assets/icons';
|
|
30
29
|
import CustomTypingIndicator from '../styled/StyledInputComponents/CustomTypingIndicator';
|
|
31
30
|
import { getIconColor } from '../../helpers/getIconColor';
|
|
31
|
+
import { getChatBackgroundColor } from '../../helpers/getChatBackground';
|
|
32
32
|
|
|
33
33
|
interface MessageListProps<TMessage extends IMessage> {
|
|
34
34
|
CustomMessage?: React.ComponentType<{
|
|
@@ -78,7 +78,6 @@ const MessageList = <TMessage extends IMessage>({
|
|
|
78
78
|
activeMessage,
|
|
79
79
|
onReadBoundaryChange,
|
|
80
80
|
}: MessageListProps<TMessage>) => {
|
|
81
|
-
const dispatch = useDispatch();
|
|
82
81
|
const { composing, messages, composingList } = useRoomState(roomJID)
|
|
83
82
|
.room! as IRoom;
|
|
84
83
|
const [isUserAtBottom, setIsUserAtBottom] = useState(true);
|
|
@@ -104,21 +103,6 @@ const MessageList = <TMessage extends IMessage>({
|
|
|
104
103
|
|
|
105
104
|
const flatListRef = useRef<FlatList<IMessage>>(null);
|
|
106
105
|
|
|
107
|
-
// Single writer for the read boundary. Publishes to the store (so the
|
|
108
|
-
// out-of-component paths that mark a room read — AppState background,
|
|
109
|
-
// the `isVisible` signal, the visible-room auto-advance, focus hooks,
|
|
110
|
-
// logout — can stamp what the user actually saw) AND to the optional
|
|
111
|
-
// host callback. Customer-reported #33.
|
|
112
|
-
const reportReadBoundary = useCallback(
|
|
113
|
-
(boundaryTs: number | null) => {
|
|
114
|
-
if (roomJID) {
|
|
115
|
-
dispatch(setReadBoundary({ chatJID: roomJID, boundaryTs }));
|
|
116
|
-
}
|
|
117
|
-
onReadBoundaryChange?.(boundaryTs);
|
|
118
|
-
},
|
|
119
|
-
[dispatch, roomJID, onReadBoundaryChange]
|
|
120
|
-
);
|
|
121
|
-
|
|
122
106
|
const addReplyMessages = useMemo(() => {
|
|
123
107
|
return messages.map((message: IMessage) => {
|
|
124
108
|
const newMessage = {
|
|
@@ -359,7 +343,7 @@ const MessageList = <TMessage extends IMessage>({
|
|
|
359
343
|
// counter so the badge disappears with the arrow.
|
|
360
344
|
setUnreadWhileScrolledUp(0);
|
|
361
345
|
newestSeenTsRef.current = null;
|
|
362
|
-
|
|
346
|
+
onReadBoundaryChange?.(null);
|
|
363
347
|
} else {
|
|
364
348
|
isUserAtBottomRef.current = false;
|
|
365
349
|
if (hasUserScrolledRef.current) {
|
|
@@ -377,12 +361,12 @@ const MessageList = <TMessage extends IMessage>({
|
|
|
377
361
|
},
|
|
378
362
|
0
|
|
379
363
|
);
|
|
380
|
-
|
|
364
|
+
onReadBoundaryChange?.(newestSeenTsRef.current);
|
|
381
365
|
}
|
|
382
366
|
setIsUserAtBottom(false);
|
|
383
367
|
}
|
|
384
368
|
},
|
|
385
|
-
[memoizedMessages,
|
|
369
|
+
[memoizedMessages, onReadBoundaryChange]
|
|
386
370
|
);
|
|
387
371
|
|
|
388
372
|
// Keep the badge in sync with messages that arrive while the user is
|
|
@@ -411,7 +395,7 @@ const MessageList = <TMessage extends IMessage>({
|
|
|
411
395
|
setIsUserAtBottom(true);
|
|
412
396
|
setUnreadWhileScrolledUp(0);
|
|
413
397
|
newestSeenTsRef.current = null;
|
|
414
|
-
|
|
398
|
+
onReadBoundaryChange?.(null);
|
|
415
399
|
scrollToBottom();
|
|
416
400
|
};
|
|
417
401
|
|
|
@@ -422,7 +406,7 @@ const MessageList = <TMessage extends IMessage>({
|
|
|
422
406
|
setIsUserAtBottom(true);
|
|
423
407
|
setUnreadWhileScrolledUp(0);
|
|
424
408
|
newestSeenTsRef.current = null;
|
|
425
|
-
|
|
409
|
+
onReadBoundaryChange?.(null);
|
|
426
410
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
427
411
|
}, [roomJID]);
|
|
428
412
|
|
|
@@ -445,7 +429,7 @@ const MessageList = <TMessage extends IMessage>({
|
|
|
445
429
|
<View
|
|
446
430
|
style={[
|
|
447
431
|
styles.container,
|
|
448
|
-
{ backgroundColor: config
|
|
432
|
+
{ backgroundColor: getChatBackgroundColor(config) },
|
|
449
433
|
]}
|
|
450
434
|
>
|
|
451
435
|
<View style={styles.backgroundImageContainer}>{BackgroundImage}</View>
|
|
@@ -69,27 +69,27 @@ export const ProfileImagePlaceholder: React.FC<
|
|
|
69
69
|
if (words.length === 0) {return '';}
|
|
70
70
|
|
|
71
71
|
if (words.length >= 2) {
|
|
72
|
-
const firstLetter = /^[
|
|
72
|
+
const firstLetter = /^[\p{L}\p{N}]$/u.test(words[0]?.[0] || '')
|
|
73
73
|
? words[0][0].toUpperCase()
|
|
74
74
|
: '';
|
|
75
|
-
const secondLetter = /^[
|
|
75
|
+
const secondLetter = /^[\p{L}\p{N}]$/u.test(words[1]?.[0] || '')
|
|
76
76
|
? words[1][0].toUpperCase()
|
|
77
77
|
: '';
|
|
78
78
|
return firstLetter + secondLetter;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
if (words.length === 1 && words[0].length >= 2) {
|
|
82
|
-
const firstLetter = /^[
|
|
82
|
+
const firstLetter = /^[\p{L}\p{N}]$/u.test(words[0][0] || '')
|
|
83
83
|
? words[0][0].toUpperCase()
|
|
84
84
|
: '';
|
|
85
|
-
const secondLetter = /^[
|
|
85
|
+
const secondLetter = /^[\p{L}\p{N}]$/u.test(words[0][1] || '')
|
|
86
86
|
? words[0][1].toUpperCase()
|
|
87
87
|
: '';
|
|
88
88
|
return firstLetter + secondLetter;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
if (words.length === 1 && words[0].length === 1) {
|
|
92
|
-
return /^[
|
|
92
|
+
return /^[\p{L}\p{N}]$/u.test(words[0][0] || '')
|
|
93
93
|
? words[0][0].toUpperCase()
|
|
94
94
|
: '';
|
|
95
95
|
}
|
|
@@ -97,16 +97,26 @@ export const ProfileImagePlaceholder: React.FC<
|
|
|
97
97
|
return '';
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
const getInitials = () =>
|
|
100
|
+
const getInitials = () =>
|
|
101
|
+
!imageSource && name ? getTwoUppercaseLetters(name) : '';
|
|
102
|
+
|
|
103
|
+
const imageSource =
|
|
104
|
+
typeof icon === 'string' && icon
|
|
105
|
+
? { uri: icon }
|
|
106
|
+
: typeof icon === 'number'
|
|
107
|
+
? icon
|
|
108
|
+
: icon && typeof (icon as any).uri === 'string' && (icon as any).uri
|
|
109
|
+
? (icon as any)
|
|
110
|
+
: null;
|
|
101
111
|
|
|
102
112
|
return (
|
|
103
113
|
<Wrapper
|
|
104
|
-
bgColor={
|
|
114
|
+
bgColor={imageSource ? 'transparent' : backgroundColor?.backgroundColor}
|
|
105
115
|
size={size}
|
|
106
116
|
isClickable={active || !!upload?.active}
|
|
107
117
|
>
|
|
108
118
|
<AvatarCircle
|
|
109
|
-
bgColor={
|
|
119
|
+
bgColor={imageSource ? 'transparent' : backgroundColor?.backgroundColor}
|
|
110
120
|
size={size}
|
|
111
121
|
isClickable={active || !!upload?.active}
|
|
112
122
|
onPress={
|
|
@@ -117,11 +127,8 @@ export const ProfileImagePlaceholder: React.FC<
|
|
|
117
127
|
: undefined
|
|
118
128
|
}
|
|
119
129
|
>
|
|
120
|
-
{
|
|
121
|
-
<AvatarImage
|
|
122
|
-
source={typeof icon === 'string' ? { uri: icon } : icon as any}
|
|
123
|
-
size={size}
|
|
124
|
-
/>
|
|
130
|
+
{imageSource ? (
|
|
131
|
+
<AvatarImage source={imageSource} size={size} />
|
|
125
132
|
) : placeholderIcon ? (
|
|
126
133
|
placeholderIcon
|
|
127
134
|
) : (
|
|
@@ -140,7 +147,7 @@ export const ProfileImagePlaceholder: React.FC<
|
|
|
140
147
|
</Overlay>
|
|
141
148
|
)}
|
|
142
149
|
</AvatarCircle>
|
|
143
|
-
{remove?.enabled &&
|
|
150
|
+
{remove?.enabled && imageSource && role !== 'participant' && (
|
|
144
151
|
<RemoveButton onPress={remove.onRemoveClick}>
|
|
145
152
|
<RemoveButtonText>×</RemoveButtonText>
|
|
146
153
|
</RemoveButton>
|