@ethora/chat-component-rn 26.8.1 → 26.8.2
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 +96 -0
- package/README.md +43 -10
- package/lib/commonjs/assets/icons.js +7 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/AuthForms/Login.js +4 -4
- package/lib/commonjs/components/AuthForms/Login.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +29 -8
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +9 -3
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +150 -14
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +34 -13
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LoginWrapper.js +2 -1
- package/lib/commonjs/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaMessage.js +29 -9
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js +5 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +13 -5
- 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 +322 -110
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +546 -203
- 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 +69 -27
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +2 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.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 -106
- 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 +563 -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 +21 -7
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +22 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +17 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +17 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js +6 -3
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/commonjs/components/styled/AudioMessage.js +2 -1
- package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
- package/lib/commonjs/components/styled/MessageImage.js +37 -9
- package/lib/commonjs/components/styled/MessageImage.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/components/styled/UnsupportedType.js +14 -4
- package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
- package/lib/commonjs/components/styled/VideoMessage.js +119 -61
- package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +184 -59
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/createMessageFromXml.js +19 -1
- package/lib/commonjs/helpers/createMessageFromXml.js.map +1 -1
- package/lib/commonjs/helpers/ensureScopedChatCache.js +2 -2
- package/lib/commonjs/helpers/ensureScopedChatCache.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/getDisplayFileName.js +79 -0
- package/lib/commonjs/helpers/getDisplayFileName.js.map +1 -0
- package/lib/commonjs/helpers/getServerReadTimestamp.js +188 -0
- package/lib/commonjs/helpers/getServerReadTimestamp.js.map +1 -0
- package/lib/commonjs/helpers/historyPreloadScheduler.js +65 -2
- package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/commonjs/helpers/initXmppRooms.js +14 -8
- package/lib/commonjs/helpers/initXmppRooms.js.map +1 -1
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js +51 -9
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/commonjs/helpers/isOwnMessage.js +75 -0
- package/lib/commonjs/helpers/isOwnMessage.js.map +1 -0
- package/lib/commonjs/helpers/keyboardLayout.js +12 -2
- package/lib/commonjs/helpers/keyboardLayout.js.map +1 -1
- package/lib/commonjs/helpers/mediaLibraryRuntime.js +31 -0
- package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/commonjs/helpers/mimeToExtension.js +6 -14
- package/lib/commonjs/helpers/mimeToExtension.js.map +1 -1
- package/lib/commonjs/helpers/msgSortableMs.js +37 -0
- package/lib/commonjs/helpers/msgSortableMs.js.map +1 -0
- package/lib/commonjs/helpers/persistCrypto.js +122 -0
- package/lib/commonjs/helpers/persistCrypto.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/resolveInitBeforeLoadUser.js +130 -17
- package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/commonjs/helpers/secureFileUrl.js +101 -0
- package/lib/commonjs/helpers/secureFileUrl.js.map +1 -0
- package/lib/commonjs/helpers/secureKeyValue.js +83 -0
- package/lib/commonjs/helpers/secureKeyValue.js.map +1 -0
- package/lib/commonjs/helpers/secureStoreRuntime.js +59 -0
- package/lib/commonjs/helpers/secureStoreRuntime.js.map +1 -0
- package/lib/commonjs/helpers/secureUserStorage.js +75 -0
- package/lib/commonjs/helpers/secureUserStorage.js.map +1 -0
- package/lib/commonjs/helpers/shallowEqual.js +36 -0
- package/lib/commonjs/helpers/shallowEqual.js.map +1 -0
- package/lib/commonjs/helpers/sheetGestures.js +32 -0
- package/lib/commonjs/helpers/sheetGestures.js.map +1 -0
- package/lib/commonjs/hooks/useChatRoomFocus.js +45 -12
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/commonjs/hooks/useChatWrapperInit.js +30 -10
- package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/commonjs/hooks/useComposing.js +27 -0
- package/lib/commonjs/hooks/useComposing.js.map +1 -1
- package/lib/commonjs/hooks/useFileToken.js +10 -0
- package/lib/commonjs/hooks/useFileToken.js.map +1 -0
- package/lib/commonjs/hooks/useLogout.js +23 -7
- 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 +50 -14
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +145 -37
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +44 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/auth.api.js +134 -60
- package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/roomMembers.api.js +1 -1
- package/lib/commonjs/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/rooms.api.js +9 -9
- package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +68 -9
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/apiClient.js +62 -112
- package/lib/commonjs/networking/apiClient.js.map +1 -1
- package/lib/commonjs/networking/authRefresh.js +332 -0
- package/lib/commonjs/networking/authRefresh.js.map +1 -0
- package/lib/commonjs/networking/stanzaHandlers.js +41 -28
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +46 -8
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.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 +124 -8
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +26 -7
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/index.js +35 -2
- package/lib/commonjs/roomStore/index.js.map +1 -1
- package/lib/commonjs/roomStore/persistence.js +226 -23
- package/lib/commonjs/roomStore/persistence.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +151 -38
- 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/commonjs/version.js +1 -1
- package/lib/module/assets/icons.js +6 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/AuthForms/Login.js +4 -4
- package/lib/module/components/AuthForms/Login.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +29 -8
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +9 -3
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +152 -16
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +35 -14
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/LoginWrapper.js +2 -1
- package/lib/module/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/MediaMessage.js +30 -10
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MessageContainer.js +5 -1
- package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +13 -5
- 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 +313 -113
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +549 -207
- 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 +70 -28
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js +2 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.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 -108
- 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 +555 -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 +21 -7
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js +22 -3
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +17 -3
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +17 -3
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallSession.js +6 -3
- package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/module/components/styled/AudioMessage.js +2 -1
- package/lib/module/components/styled/AudioMessage.js.map +1 -1
- package/lib/module/components/styled/MessageImage.js +37 -9
- package/lib/module/components/styled/MessageImage.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/components/styled/UnsupportedType.js +14 -4
- package/lib/module/components/styled/UnsupportedType.js.map +1 -1
- package/lib/module/components/styled/VideoMessage.js +120 -62
- package/lib/module/components/styled/VideoMessage.js.map +1 -1
- package/lib/module/context/xmppProvider.js +184 -60
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/createMessageFromXml.js +19 -1
- package/lib/module/helpers/createMessageFromXml.js.map +1 -1
- package/lib/module/helpers/ensureScopedChatCache.js +2 -2
- package/lib/module/helpers/ensureScopedChatCache.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/getDisplayFileName.js +73 -0
- package/lib/module/helpers/getDisplayFileName.js.map +1 -0
- package/lib/module/helpers/getServerReadTimestamp.js +181 -0
- package/lib/module/helpers/getServerReadTimestamp.js.map +1 -0
- package/lib/module/helpers/historyPreloadScheduler.js +66 -3
- package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/module/helpers/initXmppRooms.js +14 -8
- package/lib/module/helpers/initXmppRooms.js.map +1 -1
- package/lib/module/helpers/insertMessageWithDelimiter.js +52 -9
- package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/module/helpers/isOwnMessage.js +70 -0
- package/lib/module/helpers/isOwnMessage.js.map +1 -0
- package/lib/module/helpers/keyboardLayout.js +12 -2
- package/lib/module/helpers/keyboardLayout.js.map +1 -1
- package/lib/module/helpers/mediaLibraryRuntime.js +25 -0
- package/lib/module/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/module/helpers/mimeToExtension.js +6 -13
- package/lib/module/helpers/mimeToExtension.js.map +1 -1
- package/lib/module/helpers/msgSortableMs.js +32 -0
- package/lib/module/helpers/msgSortableMs.js.map +1 -0
- package/lib/module/helpers/persistCrypto.js +115 -0
- package/lib/module/helpers/persistCrypto.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/resolveInitBeforeLoadUser.js +130 -16
- package/lib/module/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/module/helpers/secureFileUrl.js +91 -0
- package/lib/module/helpers/secureFileUrl.js.map +1 -0
- package/lib/module/helpers/secureKeyValue.js +75 -0
- package/lib/module/helpers/secureKeyValue.js.map +1 -0
- package/lib/module/helpers/secureStoreRuntime.js +52 -0
- package/lib/module/helpers/secureStoreRuntime.js.map +1 -0
- package/lib/module/helpers/secureUserStorage.js +72 -0
- package/lib/module/helpers/secureUserStorage.js.map +1 -0
- package/lib/module/helpers/shallowEqual.js +31 -0
- package/lib/module/helpers/shallowEqual.js.map +1 -0
- package/lib/module/helpers/sheetGestures.js +26 -0
- package/lib/module/helpers/sheetGestures.js.map +1 -0
- package/lib/module/hooks/useChatRoomFocus.js +46 -13
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/module/hooks/useChatWrapperInit.js +30 -10
- package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/module/hooks/useComposing.js +28 -1
- package/lib/module/hooks/useComposing.js.map +1 -1
- package/lib/module/hooks/useFileToken.js +5 -0
- package/lib/module/hooks/useFileToken.js.map +1 -0
- package/lib/module/hooks/useLogout.js +23 -7
- 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 +52 -16
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/i18n/strings.js +145 -37
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +14 -2
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/auth.api.js +131 -59
- package/lib/module/networking/api-requests/auth.api.js.map +1 -1
- package/lib/module/networking/api-requests/roomMembers.api.js +1 -1
- package/lib/module/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/module/networking/api-requests/rooms.api.js +9 -9
- package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/module/networking/api-requests/user.api.js +64 -7
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/apiClient.js +61 -113
- package/lib/module/networking/apiClient.js.map +1 -1
- package/lib/module/networking/authRefresh.js +321 -0
- package/lib/module/networking/authRefresh.js.map +1 -0
- package/lib/module/networking/stanzaHandlers.js +41 -28
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +46 -8
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.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 +124 -8
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +26 -7
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/index.js +37 -4
- package/lib/module/roomStore/index.js.map +1 -1
- package/lib/module/roomStore/persistence.js +223 -22
- package/lib/module/roomStore/persistence.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +139 -34
- 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/module/version.js +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/AuthForms/Login.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/LoginWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts +10 -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/FilePreviewModal/PdfView.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/RoomComponents/styled/LastMessageFile.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
- package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
- package/lib/typescript/components/styled/MessageImage.d.ts +14 -0
- package/lib/typescript/components/styled/MessageImage.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/components/styled/UnsupportedType.d.ts.map +1 -1
- package/lib/typescript/components/styled/VideoMessage.d.ts +8 -0
- package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/createMessageFromXml.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/getDisplayFileName.d.ts +49 -0
- package/lib/typescript/helpers/getDisplayFileName.d.ts.map +1 -0
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts +108 -0
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts.map +1 -0
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
- package/lib/typescript/helpers/initXmppRooms.d.ts.map +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
- package/lib/typescript/helpers/isOwnMessage.d.ts +36 -0
- package/lib/typescript/helpers/isOwnMessage.d.ts.map +1 -0
- package/lib/typescript/helpers/keyboardLayout.d.ts +5 -1
- package/lib/typescript/helpers/keyboardLayout.d.ts.map +1 -1
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +3 -0
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/mimeToExtension.d.ts +0 -15
- package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -1
- package/lib/typescript/helpers/msgSortableMs.d.ts +2 -0
- package/lib/typescript/helpers/msgSortableMs.d.ts.map +1 -0
- package/lib/typescript/helpers/persistCrypto.d.ts +13 -0
- package/lib/typescript/helpers/persistCrypto.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/resolveInitBeforeLoadUser.d.ts.map +1 -1
- package/lib/typescript/helpers/secureFileUrl.d.ts +7 -0
- package/lib/typescript/helpers/secureFileUrl.d.ts.map +1 -0
- package/lib/typescript/helpers/secureKeyValue.d.ts +13 -0
- package/lib/typescript/helpers/secureKeyValue.d.ts.map +1 -0
- package/lib/typescript/helpers/secureStoreRuntime.d.ts +29 -0
- package/lib/typescript/helpers/secureStoreRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/secureUserStorage.d.ts +23 -0
- package/lib/typescript/helpers/secureUserStorage.d.ts.map +1 -0
- package/lib/typescript/helpers/shallowEqual.d.ts +11 -0
- package/lib/typescript/helpers/shallowEqual.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/hooks/useChatRoomFocus.d.ts +4 -1
- package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
- package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
- package/lib/typescript/hooks/useComposing.d.ts.map +1 -1
- package/lib/typescript/hooks/useFileToken.d.ts +2 -0
- package/lib/typescript/hooks/useFileToken.d.ts.map +1 -0
- 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/hooks/useUnreadMessagesCounter.d.ts +1 -0
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +9 -2
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts +3 -1
- package/lib/typescript/networking/api-requests/auth.api.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/apiClient.d.ts +12 -6
- package/lib/typescript/networking/apiClient.d.ts.map +1 -1
- package/lib/typescript/networking/authRefresh.d.ts +95 -0
- package/lib/typescript/networking/authRefresh.d.ts.map +1 -0
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +10 -2
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.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 +14 -0
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts +16 -0
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/index.d.ts.map +1 -1
- package/lib/typescript/roomStore/persistence.d.ts +18 -1
- package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +43 -3
- 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/types.d.ts +50 -5
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +41 -28
- package/src/assets/icons.tsx +48 -9
- package/src/components/AuthForms/Login.tsx +3 -3
- package/src/components/Header/HeaderRoomList.tsx +29 -7
- package/src/components/MainComponents/ChatHeader.tsx +9 -3
- package/src/components/MainComponents/ChatRoom.tsx +161 -15
- package/src/components/MainComponents/ChatWrapper.tsx +36 -20
- package/src/components/MainComponents/LoginWrapper.tsx +1 -0
- package/src/components/MainComponents/MediaMessage.tsx +26 -8
- package/src/components/MainComponents/MessageContainer.tsx +5 -1
- package/src/components/MainComponents/MessageList.tsx +23 -4
- 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 +333 -97
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +600 -282
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +244 -0
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +79 -38
- package/src/components/Modals/FilePreviewModal/PdfView.tsx +2 -1
- 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 -119
- package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +12 -1
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +624 -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 +18 -3
- package/src/components/RoomComponents/styled/LastMessageFile.tsx +28 -4
- package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +18 -3
- package/src/components/RoomComponents/styled/LastMessageVideo.tsx +18 -3
- package/src/components/VideoCalls/VideoCallSession.tsx +8 -3
- package/src/components/styled/AudioMessage.tsx +2 -1
- package/src/components/styled/MessageImage.tsx +53 -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/components/styled/UnsupportedType.tsx +14 -4
- package/src/components/styled/VideoMessage.tsx +131 -54
- package/src/context/xmppProvider.tsx +216 -57
- package/src/helpers/createMessageFromXml.ts +20 -1
- package/src/helpers/ensureScopedChatCache.ts +2 -2
- package/src/helpers/getChatBackground.ts +18 -0
- package/src/helpers/getDisplayFileName.ts +87 -0
- package/src/helpers/getServerReadTimestamp.ts +197 -0
- package/src/helpers/historyPreloadScheduler.ts +80 -3
- package/src/helpers/initXmppRooms.tsx +14 -10
- package/src/helpers/insertMessageWithDelimiter.ts +55 -19
- package/src/helpers/isOwnMessage.ts +90 -0
- package/src/helpers/keyboardLayout.ts +23 -2
- package/src/helpers/mediaLibraryRuntime.ts +25 -0
- package/src/helpers/mimeToExtension.ts +6 -22
- package/src/helpers/msgSortableMs.ts +25 -0
- package/src/helpers/persistCrypto.ts +127 -0
- package/src/helpers/pickImageAsset.ts +68 -0
- package/src/helpers/pushPayload.ts +62 -0
- package/src/helpers/resolveInitBeforeLoadUser.ts +125 -18
- package/src/helpers/secureFileUrl.ts +103 -0
- package/src/helpers/secureKeyValue.ts +80 -0
- package/src/helpers/secureStoreRuntime.ts +62 -0
- package/src/helpers/secureUserStorage.ts +80 -0
- package/src/helpers/shallowEqual.ts +33 -0
- package/src/helpers/sheetGestures.ts +25 -0
- package/src/hooks/useChatRoomFocus.ts +49 -9
- package/src/hooks/useChatWrapperInit.ts +30 -10
- package/src/hooks/useComposing.tsx +37 -1
- package/src/hooks/useFileToken.ts +7 -0
- package/src/hooks/useLogout.tsx +29 -9
- package/src/hooks/usePendingNotification.ts +5 -11
- package/src/hooks/useSendMessage.tsx +60 -15
- package/src/hooks/useUnreadMessagesCounter.ts +11 -0
- package/src/i18n/strings.ts +145 -37
- package/src/main.ts +26 -2
- package/src/networking/api-requests/auth.api.ts +156 -48
- package/src/networking/api-requests/roomMembers.api.ts +1 -1
- package/src/networking/api-requests/rooms.api.ts +9 -9
- package/src/networking/api-requests/user.api.ts +79 -7
- package/src/networking/apiClient.ts +68 -123
- package/src/networking/authRefresh.ts +451 -0
- package/src/networking/stanzaHandlers.ts +44 -28
- package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +71 -10
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +6 -1
- package/src/networking/xmpp/subscribeToRoomMessages.xmpp.ts +12 -1
- package/src/networking/xmppClient.ts +141 -9
- package/src/roomStore/chatSettingsSlice.ts +34 -10
- package/src/roomStore/index.ts +40 -4
- package/src/roomStore/persistence.ts +234 -24
- package/src/roomStore/roomsSlice.ts +161 -29
- package/src/services/pushSubscriptionService.ts +18 -13
- package/src/types/types.ts +72 -5
- package/src/version.ts +1 -1
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {
|
|
5
|
+
Animated,
|
|
6
|
+
Image,
|
|
7
|
+
StyleProp,
|
|
8
|
+
StyleSheet,
|
|
9
|
+
Text,
|
|
10
|
+
TextStyle,
|
|
11
|
+
TouchableOpacity,
|
|
12
|
+
View,
|
|
13
|
+
} from 'react-native';
|
|
14
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
15
|
+
import { BackIcon } from '../../../assets/icons';
|
|
16
|
+
import { getAvatarTextColor } from '../../../helpers/getAvatarColor';
|
|
17
|
+
|
|
18
|
+
/** Height of the expanded photo hero. */
|
|
19
|
+
export const HERO_HEIGHT = 320;
|
|
20
|
+
/** Back / "…" row, directly below the status-bar inset. */
|
|
21
|
+
export const TOP_BAR_BUTTONS = 60;
|
|
22
|
+
/**
|
|
23
|
+
* Avatar + name row underneath it, revealed as the header collapses.
|
|
24
|
+
* Taller than the 48pt avatar it holds, so the row breathes: the extra
|
|
25
|
+
* height splits evenly above and below (the row centres its content),
|
|
26
|
+
* putting real space between the avatar and both the buttons above and
|
|
27
|
+
* the content below.
|
|
28
|
+
*/
|
|
29
|
+
export const TOP_BAR_NAME = 92;
|
|
30
|
+
/** Content band of the collapsed bar, below the status-bar inset. */
|
|
31
|
+
export const TOP_BAR_BAND = TOP_BAR_BUTTONS + TOP_BAR_NAME;
|
|
32
|
+
/** How far above the fully-collapsed point the bar starts fading in. */
|
|
33
|
+
const COLLAPSE_RAMP = 48;
|
|
34
|
+
/**
|
|
35
|
+
* Blur strength once the header is fully collapsed. The design's collapsed
|
|
36
|
+
* bar is frosted heavily — the picture is a mood, not a subject — so this
|
|
37
|
+
* sits near the top of expo-blur's 0-100 range, with a dim over it to keep
|
|
38
|
+
* the white text and the sharp round avatar reading against it.
|
|
39
|
+
*/
|
|
40
|
+
const BLUR_INTENSITY = 92;
|
|
41
|
+
/** Darkening applied on top of the blur (and used alone without it). */
|
|
42
|
+
const FROST_DIM = 'rgba(0,0,0,0.28)';
|
|
43
|
+
/** Height of the readability gradient under the name and buttons. */
|
|
44
|
+
const SCRIM_HEIGHT = 220;
|
|
45
|
+
/** Bands the gradient is built from — enough that no step is visible. */
|
|
46
|
+
const SCRIM_BANDS = 16;
|
|
47
|
+
/** Darkest the gradient gets, at the very bottom of the hero. */
|
|
48
|
+
const SCRIM_MAX_ALPHA = 0.45;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* How far above the hero its backdrop reaches. Over-scrolling downwards
|
|
52
|
+
* exposes that band, and the picture grows into it (anchored at its own
|
|
53
|
+
* bottom edge) rather than a second copy being painted there.
|
|
54
|
+
*/
|
|
55
|
+
const OVERSCROLL_REACH = 400;
|
|
56
|
+
|
|
57
|
+
// expo-blur is an OPTIONAL peer. Having the JS package is not enough — the
|
|
58
|
+
// native view has to be in the binary too, and an app that installed the
|
|
59
|
+
// package without rebuilding renders a red "Unimplemented component:
|
|
60
|
+
// ExpoBlurView" box instead of a blur. `requireNativeModule` throws when
|
|
61
|
+
// that native half is missing, which is the only reliable way to tell the
|
|
62
|
+
// two apart, so probe it once and fall back to a plain dim otherwise.
|
|
63
|
+
let BlurView: any = null;
|
|
64
|
+
try {
|
|
65
|
+
const { requireNativeModule } = require('expo-modules-core');
|
|
66
|
+
requireNativeModule('ExpoBlur');
|
|
67
|
+
BlurView = require('expo-blur').BlurView ?? null;
|
|
68
|
+
} catch {
|
|
69
|
+
BlurView = null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** True when the frosted-glass layer is the real thing, not the dim. */
|
|
73
|
+
export const hasNativeBlur = () => !!BlurView;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Bottom-up darkening so white text stays readable over a photo.
|
|
77
|
+
*
|
|
78
|
+
* A single flat overlay (what this was) has a hard top edge that reads as
|
|
79
|
+
* "the bottom half of the picture is dark". There is no gradient
|
|
80
|
+
* dependency in this package, so it is stacked out of thin bands whose
|
|
81
|
+
* alpha ramps quadratically — at 16 bands over 220 pt the steps are below
|
|
82
|
+
* what the eye picks up on a photo.
|
|
83
|
+
*/
|
|
84
|
+
const ScrimGradient: React.FC = () => (
|
|
85
|
+
<View pointerEvents="none" style={styles.scrim}>
|
|
86
|
+
{Array.from({ length: SCRIM_BANDS }, (_, i) => (
|
|
87
|
+
<View
|
|
88
|
+
key={i}
|
|
89
|
+
style={{
|
|
90
|
+
height: SCRIM_HEIGHT / SCRIM_BANDS,
|
|
91
|
+
backgroundColor: `rgba(0,0,0,${(
|
|
92
|
+
SCRIM_MAX_ALPHA * ((i + 1) / SCRIM_BANDS) ** 2
|
|
93
|
+
).toFixed(3)})`,
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
))}
|
|
97
|
+
</View>
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
const FrostLayer: React.FC<{ tint?: 'dark' | 'light' }> = ({ tint = 'dark' }) =>
|
|
101
|
+
BlurView ? (
|
|
102
|
+
<>
|
|
103
|
+
<BlurView
|
|
104
|
+
intensity={BLUR_INTENSITY}
|
|
105
|
+
tint={tint}
|
|
106
|
+
style={StyleSheet.absoluteFill}
|
|
107
|
+
/>
|
|
108
|
+
<View style={[StyleSheet.absoluteFill, styles.frostDim]} />
|
|
109
|
+
</>
|
|
110
|
+
) : (
|
|
111
|
+
<View style={[StyleSheet.absoluteFill, styles.frostFallback]} />
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
export interface HeroAction {
|
|
115
|
+
key: string;
|
|
116
|
+
label: string;
|
|
117
|
+
/** Rendered inside a circle tinted for the current background. */
|
|
118
|
+
icon: (color: string) => React.ReactNode;
|
|
119
|
+
onPress: () => void;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
interface CommonProps {
|
|
123
|
+
title: string;
|
|
124
|
+
subtitle?: string;
|
|
125
|
+
imageUri?: string | null;
|
|
126
|
+
/** Background when the chat has no picture — one flat colour, no scrims. */
|
|
127
|
+
fallbackColor: string;
|
|
128
|
+
/** Two uppercase letters shown on that background. */
|
|
129
|
+
initials: string;
|
|
130
|
+
scrollY: Animated.Value;
|
|
131
|
+
/** Prefixes every testID, so each screen's tests address their own. */
|
|
132
|
+
testIDPrefix?: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Everything the screen needs to line its scroll content up with the bar. */
|
|
136
|
+
export const useHeaderMetrics = () => {
|
|
137
|
+
const insets = useSafeAreaInsets();
|
|
138
|
+
const barHeight = insets.top + TOP_BAR_BAND;
|
|
139
|
+
return {
|
|
140
|
+
insets,
|
|
141
|
+
barHeight,
|
|
142
|
+
/** Scroll distance between the expanded hero and the collapsed bar. */
|
|
143
|
+
collapseDistance: Math.max(HERO_HEIGHT - barHeight, 1),
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const useCollapse = (scrollY: Animated.Value, collapseDistance: number) =>
|
|
148
|
+
scrollY.interpolate({
|
|
149
|
+
inputRange: [
|
|
150
|
+
Math.max(collapseDistance - COLLAPSE_RAMP, 0),
|
|
151
|
+
collapseDistance,
|
|
152
|
+
],
|
|
153
|
+
outputRange: [0, 1],
|
|
154
|
+
extrapolate: 'clamp',
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The chat picture, blown up to a full-bleed hero with the name, member
|
|
159
|
+
* count and the round action buttons on top of it.
|
|
160
|
+
*
|
|
161
|
+
* It lives INSIDE the ScrollView (rather than behind it) so the action
|
|
162
|
+
* buttons stay tappable — an absolutely-positioned hero would sit under a
|
|
163
|
+
* full-screen scroll surface that swallows every touch. Parallax is done
|
|
164
|
+
* on the inner image instead: the wrapper keeps its layout height while
|
|
165
|
+
* the picture drifts at ~⅓ of the scroll speed, and over-scrolling
|
|
166
|
+
* upwards scales it up the way iOS profile headers do.
|
|
167
|
+
*/
|
|
168
|
+
export const ProfileHero: React.FC<
|
|
169
|
+
CommonProps & {
|
|
170
|
+
actions: HeroAction[];
|
|
171
|
+
/** Rendered to the right of the name (the profile's Leave button). */
|
|
172
|
+
titleAccessory?: React.ReactNode;
|
|
173
|
+
titleStyle?: StyleProp<TextStyle>;
|
|
174
|
+
subtitleStyle?: StyleProp<TextStyle>;
|
|
175
|
+
}
|
|
176
|
+
> = ({
|
|
177
|
+
title,
|
|
178
|
+
subtitle,
|
|
179
|
+
imageUri,
|
|
180
|
+
fallbackColor,
|
|
181
|
+
initials,
|
|
182
|
+
scrollY,
|
|
183
|
+
actions,
|
|
184
|
+
titleAccessory,
|
|
185
|
+
titleStyle,
|
|
186
|
+
subtitleStyle,
|
|
187
|
+
testIDPrefix = 'chat-profile',
|
|
188
|
+
}) => {
|
|
189
|
+
const { collapseDistance } = useHeaderMetrics();
|
|
190
|
+
const parallax = scrollY.interpolate({
|
|
191
|
+
inputRange: [0, HERO_HEIGHT],
|
|
192
|
+
outputRange: [0, HERO_HEIGHT * 0.35],
|
|
193
|
+
// Clamped on the left: with `extend` an over-scroll pulled the picture
|
|
194
|
+
// UP off its own bottom edge, exposing a band of the backdrop colour
|
|
195
|
+
// under it. Pulling down is the scale's job alone.
|
|
196
|
+
extrapolateLeft: 'clamp',
|
|
197
|
+
extrapolateRight: 'clamp',
|
|
198
|
+
});
|
|
199
|
+
const scale = scrollY.interpolate({
|
|
200
|
+
inputRange: [-HERO_HEIGHT, 0],
|
|
201
|
+
outputRange: [2, 1],
|
|
202
|
+
extrapolateRight: 'clamp',
|
|
203
|
+
});
|
|
204
|
+
// The name and buttons are gone well before the collapsed bar arrives,
|
|
205
|
+
// so the two never overlap mid-scroll.
|
|
206
|
+
const contentOpacity = scrollY.interpolate({
|
|
207
|
+
inputRange: [0, HERO_HEIGHT * 0.4],
|
|
208
|
+
outputRange: [1, 0],
|
|
209
|
+
extrapolate: 'clamp',
|
|
210
|
+
});
|
|
211
|
+
const collapsed = useCollapse(scrollY, collapseDistance);
|
|
212
|
+
|
|
213
|
+
// On a photo everything is white over a bottom scrim. On the flat
|
|
214
|
+
// fallback colour there is no scrim at all — that double-tone banding
|
|
215
|
+
// was two stacked scrims showing their seam — so the text takes
|
|
216
|
+
// whichever of black/white reads on that colour.
|
|
217
|
+
const onPhoto = !!imageUri;
|
|
218
|
+
const contentColor = onPhoto ? '#FFFFFF' : getAvatarTextColor(fallbackColor);
|
|
219
|
+
// The glyphs inside the circles are always white — several of the SDK's
|
|
220
|
+
// icons paint white regardless of their `color` prop, so tinting the
|
|
221
|
+
// rest to match the title left a mix of black and white glyphs in one
|
|
222
|
+
// row. The circle darkens instead, which keeps them readable on a light
|
|
223
|
+
// fill as well as on a photo.
|
|
224
|
+
const iconColor = '#FFFFFF';
|
|
225
|
+
const circleTint = onPhoto
|
|
226
|
+
? 'rgba(255,255,255,0.22)'
|
|
227
|
+
: contentColor === '#FFFFFF'
|
|
228
|
+
? 'rgba(255,255,255,0.22)'
|
|
229
|
+
: 'rgba(0,0,0,0.22)';
|
|
230
|
+
|
|
231
|
+
return (
|
|
232
|
+
<View style={[styles.hero, { backgroundColor: fallbackColor }]}>
|
|
233
|
+
<View style={[styles.backdropClip, { backgroundColor: fallbackColor }]}>
|
|
234
|
+
<Animated.View
|
|
235
|
+
style={[
|
|
236
|
+
styles.backdrop,
|
|
237
|
+
{
|
|
238
|
+
transform: [
|
|
239
|
+
{ translateY: parallax },
|
|
240
|
+
// Scale about the bottom edge (translate → scale →
|
|
241
|
+
// translate back, RN has no transform-origin) so pulling
|
|
242
|
+
// down grows the picture upwards into the exposed band by
|
|
243
|
+
// exactly the amount that band opened.
|
|
244
|
+
{ translateY: HERO_HEIGHT / 2 },
|
|
245
|
+
{ scale },
|
|
246
|
+
{ translateY: -HERO_HEIGHT / 2 },
|
|
247
|
+
],
|
|
248
|
+
},
|
|
249
|
+
]}
|
|
250
|
+
>
|
|
251
|
+
{onPhoto ? (
|
|
252
|
+
<Image
|
|
253
|
+
testID={`${testIDPrefix}-hero-image`}
|
|
254
|
+
source={{ uri: imageUri as string }}
|
|
255
|
+
style={StyleSheet.absoluteFill}
|
|
256
|
+
resizeMode="cover"
|
|
257
|
+
/>
|
|
258
|
+
) : (
|
|
259
|
+
<View style={styles.initialsWrap}>
|
|
260
|
+
<Text
|
|
261
|
+
testID={`${testIDPrefix}-hero-initials`}
|
|
262
|
+
style={[styles.heroInitials, { color: contentColor }]}
|
|
263
|
+
>
|
|
264
|
+
{initials}
|
|
265
|
+
</Text>
|
|
266
|
+
</View>
|
|
267
|
+
)}
|
|
268
|
+
</Animated.View>
|
|
269
|
+
|
|
270
|
+
{/* Frosts the picture as the header collapses — the same layer the
|
|
271
|
+
* collapsed bar sits on, so the transition reads as one motion.
|
|
272
|
+
* Only over a photo: there is nothing to blur on a flat colour,
|
|
273
|
+
* and the dim fallback would just darken it into a second shade
|
|
274
|
+
* of itself. */}
|
|
275
|
+
{onPhoto && (
|
|
276
|
+
<Animated.View
|
|
277
|
+
testID={`${testIDPrefix}-hero-blur`}
|
|
278
|
+
pointerEvents="none"
|
|
279
|
+
style={[StyleSheet.absoluteFill, { opacity: collapsed }]}
|
|
280
|
+
>
|
|
281
|
+
<FrostLayer />
|
|
282
|
+
</Animated.View>
|
|
283
|
+
)}
|
|
284
|
+
|
|
285
|
+
{onPhoto && <ScrimGradient />}
|
|
286
|
+
</View>
|
|
287
|
+
|
|
288
|
+
<Animated.View style={[styles.heroContent, { opacity: contentOpacity }]}>
|
|
289
|
+
<View style={styles.titleRow}>
|
|
290
|
+
<Text
|
|
291
|
+
numberOfLines={2}
|
|
292
|
+
style={[
|
|
293
|
+
styles.heroTitle,
|
|
294
|
+
styles.titleText,
|
|
295
|
+
{ color: contentColor },
|
|
296
|
+
titleStyle,
|
|
297
|
+
]}
|
|
298
|
+
>
|
|
299
|
+
{title}
|
|
300
|
+
</Text>
|
|
301
|
+
{titleAccessory}
|
|
302
|
+
</View>
|
|
303
|
+
{!!subtitle && (
|
|
304
|
+
<Text
|
|
305
|
+
style={[
|
|
306
|
+
styles.heroSubtitle,
|
|
307
|
+
{ color: contentColor, opacity: 0.85 },
|
|
308
|
+
subtitleStyle,
|
|
309
|
+
]}
|
|
310
|
+
>
|
|
311
|
+
{subtitle}
|
|
312
|
+
</Text>
|
|
313
|
+
)}
|
|
314
|
+
{actions.length > 0 && (
|
|
315
|
+
<View style={styles.actionsRow}>
|
|
316
|
+
{actions.map((action) => (
|
|
317
|
+
<TouchableOpacity
|
|
318
|
+
key={action.key}
|
|
319
|
+
testID={`${testIDPrefix}-action-${action.key}`}
|
|
320
|
+
activeOpacity={0.7}
|
|
321
|
+
style={styles.action}
|
|
322
|
+
onPress={action.onPress}
|
|
323
|
+
>
|
|
324
|
+
<View
|
|
325
|
+
style={[styles.actionCircle, { backgroundColor: circleTint }]}
|
|
326
|
+
>
|
|
327
|
+
{action.icon(iconColor)}
|
|
328
|
+
</View>
|
|
329
|
+
<Text
|
|
330
|
+
style={[styles.actionLabel, { color: contentColor }]}
|
|
331
|
+
numberOfLines={1}
|
|
332
|
+
adjustsFontSizeToFit
|
|
333
|
+
minimumFontScale={0.8}
|
|
334
|
+
>
|
|
335
|
+
{action.label}
|
|
336
|
+
</Text>
|
|
337
|
+
</TouchableOpacity>
|
|
338
|
+
))}
|
|
339
|
+
</View>
|
|
340
|
+
)}
|
|
341
|
+
</Animated.View>
|
|
342
|
+
</View>
|
|
343
|
+
);
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* The bar pinned over the hero: back button and the "…" menu are always
|
|
348
|
+
* there, while the frosted picture, small avatar and name fade in as the
|
|
349
|
+
* hero scrolls away — the collapsed state from the design's third screen.
|
|
350
|
+
*/
|
|
351
|
+
export const ProfileTopBar: React.FC<
|
|
352
|
+
CommonProps & {
|
|
353
|
+
onBack: () => void;
|
|
354
|
+
menu?: React.ReactNode;
|
|
355
|
+
titleStyle?: StyleProp<TextStyle>;
|
|
356
|
+
}
|
|
357
|
+
> = ({
|
|
358
|
+
title,
|
|
359
|
+
subtitle,
|
|
360
|
+
imageUri,
|
|
361
|
+
fallbackColor,
|
|
362
|
+
initials,
|
|
363
|
+
scrollY,
|
|
364
|
+
onBack,
|
|
365
|
+
menu,
|
|
366
|
+
titleStyle,
|
|
367
|
+
testIDPrefix = 'chat-profile',
|
|
368
|
+
}) => {
|
|
369
|
+
const { insets, barHeight, collapseDistance } = useHeaderMetrics();
|
|
370
|
+
const collapsed = useCollapse(scrollY, collapseDistance);
|
|
371
|
+
const rise = collapsed.interpolate({
|
|
372
|
+
inputRange: [0, 1],
|
|
373
|
+
outputRange: [10, 0],
|
|
374
|
+
});
|
|
375
|
+
const onPhoto = !!imageUri;
|
|
376
|
+
const contentColor = onPhoto ? '#FFFFFF' : getAvatarTextColor(fallbackColor);
|
|
377
|
+
|
|
378
|
+
return (
|
|
379
|
+
<View
|
|
380
|
+
pointerEvents="box-none"
|
|
381
|
+
style={[styles.topBar, { height: barHeight, paddingTop: insets.top }]}
|
|
382
|
+
>
|
|
383
|
+
{/* Background layer: the same picture, cropped to the bar and frosted,
|
|
384
|
+
* so nothing flips colour mid-scroll. */}
|
|
385
|
+
<Animated.View
|
|
386
|
+
pointerEvents="none"
|
|
387
|
+
style={[
|
|
388
|
+
StyleSheet.absoluteFill,
|
|
389
|
+
{ backgroundColor: fallbackColor, opacity: collapsed },
|
|
390
|
+
]}
|
|
391
|
+
>
|
|
392
|
+
{onPhoto && (
|
|
393
|
+
<>
|
|
394
|
+
<Image
|
|
395
|
+
source={{ uri: imageUri as string }}
|
|
396
|
+
style={StyleSheet.absoluteFill}
|
|
397
|
+
resizeMode="cover"
|
|
398
|
+
/>
|
|
399
|
+
<FrostLayer />
|
|
400
|
+
</>
|
|
401
|
+
)}
|
|
402
|
+
</Animated.View>
|
|
403
|
+
|
|
404
|
+
<View style={styles.topBarButtons}>
|
|
405
|
+
<TouchableOpacity
|
|
406
|
+
testID={`${testIDPrefix}-back`}
|
|
407
|
+
activeOpacity={0.7}
|
|
408
|
+
onPress={onBack}
|
|
409
|
+
style={styles.roundButton}
|
|
410
|
+
hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}
|
|
411
|
+
>
|
|
412
|
+
<BackIcon color="#FFFFFF" />
|
|
413
|
+
</TouchableOpacity>
|
|
414
|
+
<View style={styles.topBarRight}>{menu}</View>
|
|
415
|
+
</View>
|
|
416
|
+
|
|
417
|
+
{/* Avatar + name on their own row, as in the design's collapsed
|
|
418
|
+
* screen. It only appears once the hero has scrolled away, so it
|
|
419
|
+
* never competes with the big title over the picture. */}
|
|
420
|
+
<Animated.View
|
|
421
|
+
testID={`${testIDPrefix}-collapsed-title`}
|
|
422
|
+
pointerEvents="none"
|
|
423
|
+
style={[
|
|
424
|
+
styles.collapsedTitle,
|
|
425
|
+
{ opacity: collapsed, transform: [{ translateY: rise }] },
|
|
426
|
+
]}
|
|
427
|
+
>
|
|
428
|
+
<View style={styles.collapsedAvatar}>
|
|
429
|
+
{onPhoto ? (
|
|
430
|
+
<Image
|
|
431
|
+
source={{ uri: imageUri as string }}
|
|
432
|
+
style={styles.collapsedAvatarImage}
|
|
433
|
+
/>
|
|
434
|
+
) : (
|
|
435
|
+
<View
|
|
436
|
+
style={[
|
|
437
|
+
styles.collapsedAvatarImage,
|
|
438
|
+
styles.initialsWrap,
|
|
439
|
+
{ backgroundColor: fallbackColor },
|
|
440
|
+
]}
|
|
441
|
+
>
|
|
442
|
+
<Text style={[styles.collapsedInitials, { color: contentColor }]}>
|
|
443
|
+
{initials}
|
|
444
|
+
</Text>
|
|
445
|
+
</View>
|
|
446
|
+
)}
|
|
447
|
+
</View>
|
|
448
|
+
<View style={styles.collapsedText}>
|
|
449
|
+
<Text numberOfLines={1} style={[styles.collapsedName, titleStyle]}>
|
|
450
|
+
{title}
|
|
451
|
+
</Text>
|
|
452
|
+
{!!subtitle && (
|
|
453
|
+
<Text numberOfLines={1} style={styles.collapsedSubtitle}>
|
|
454
|
+
{subtitle}
|
|
455
|
+
</Text>
|
|
456
|
+
)}
|
|
457
|
+
</View>
|
|
458
|
+
</Animated.View>
|
|
459
|
+
</View>
|
|
460
|
+
);
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
const styles = StyleSheet.create({
|
|
464
|
+
hero: {
|
|
465
|
+
width: '100%',
|
|
466
|
+
height: HERO_HEIGHT,
|
|
467
|
+
justifyContent: 'flex-end',
|
|
468
|
+
},
|
|
469
|
+
// Reaches above the hero and clips its own contents, so the picture can
|
|
470
|
+
// grow up into the over-scroll band without spilling over the cards
|
|
471
|
+
// below when it parallaxes down.
|
|
472
|
+
backdropClip: {
|
|
473
|
+
position: 'absolute',
|
|
474
|
+
left: 0,
|
|
475
|
+
right: 0,
|
|
476
|
+
bottom: 0,
|
|
477
|
+
height: HERO_HEIGHT + OVERSCROLL_REACH,
|
|
478
|
+
overflow: 'hidden',
|
|
479
|
+
},
|
|
480
|
+
backdrop: {
|
|
481
|
+
position: 'absolute',
|
|
482
|
+
left: 0,
|
|
483
|
+
right: 0,
|
|
484
|
+
bottom: 0,
|
|
485
|
+
height: HERO_HEIGHT,
|
|
486
|
+
},
|
|
487
|
+
initialsWrap: {
|
|
488
|
+
...StyleSheet.absoluteFill,
|
|
489
|
+
alignItems: 'center',
|
|
490
|
+
justifyContent: 'center',
|
|
491
|
+
},
|
|
492
|
+
heroInitials: {
|
|
493
|
+
fontSize: 64,
|
|
494
|
+
fontWeight: '600',
|
|
495
|
+
// Sit in the upper half so the name below never collides with it.
|
|
496
|
+
marginBottom: 120,
|
|
497
|
+
},
|
|
498
|
+
frostDim: {
|
|
499
|
+
backgroundColor: FROST_DIM,
|
|
500
|
+
},
|
|
501
|
+
frostFallback: {
|
|
502
|
+
backgroundColor: 'rgba(0,0,0,0.35)',
|
|
503
|
+
},
|
|
504
|
+
// Only over a photo: keeps white text readable without tinting the flat
|
|
505
|
+
// fallback colour.
|
|
506
|
+
scrim: {
|
|
507
|
+
...StyleSheet.absoluteFill,
|
|
508
|
+
top: undefined,
|
|
509
|
+
height: SCRIM_HEIGHT,
|
|
510
|
+
justifyContent: 'flex-end',
|
|
511
|
+
},
|
|
512
|
+
heroContent: {
|
|
513
|
+
paddingHorizontal: 20,
|
|
514
|
+
paddingBottom: 20,
|
|
515
|
+
},
|
|
516
|
+
// The accessory (the profile's Leave button) is pushed to the far right;
|
|
517
|
+
// the name takes what is left of the row.
|
|
518
|
+
titleRow: {
|
|
519
|
+
flexDirection: 'row',
|
|
520
|
+
alignItems: 'center',
|
|
521
|
+
justifyContent: 'space-between',
|
|
522
|
+
gap: 12,
|
|
523
|
+
},
|
|
524
|
+
titleText: {
|
|
525
|
+
flexShrink: 1,
|
|
526
|
+
},
|
|
527
|
+
heroTitle: {
|
|
528
|
+
fontSize: 26,
|
|
529
|
+
fontWeight: '600',
|
|
530
|
+
},
|
|
531
|
+
heroSubtitle: {
|
|
532
|
+
fontSize: 14,
|
|
533
|
+
marginTop: 2,
|
|
534
|
+
},
|
|
535
|
+
// Centred: Search / Leave / Report.
|
|
536
|
+
actionsRow: {
|
|
537
|
+
flexDirection: 'row',
|
|
538
|
+
justifyContent: 'center',
|
|
539
|
+
marginTop: 20,
|
|
540
|
+
gap: 16,
|
|
541
|
+
},
|
|
542
|
+
// minWidth, not a fixed width: translated labels ("Rechercher",
|
|
543
|
+
// "Denunciar") don't fit 64pt and used to wrap mid-word. English labels
|
|
544
|
+
// are shorter than 64pt, so their layout is unchanged.
|
|
545
|
+
action: {
|
|
546
|
+
alignItems: 'center',
|
|
547
|
+
minWidth: 64,
|
|
548
|
+
maxWidth: 96,
|
|
549
|
+
},
|
|
550
|
+
actionCircle: {
|
|
551
|
+
width: 56,
|
|
552
|
+
height: 56,
|
|
553
|
+
borderRadius: 28,
|
|
554
|
+
alignItems: 'center',
|
|
555
|
+
justifyContent: 'center',
|
|
556
|
+
},
|
|
557
|
+
actionLabel: {
|
|
558
|
+
fontSize: 12,
|
|
559
|
+
marginTop: 6,
|
|
560
|
+
},
|
|
561
|
+
topBar: {
|
|
562
|
+
position: 'absolute',
|
|
563
|
+
top: 0,
|
|
564
|
+
left: 0,
|
|
565
|
+
right: 0,
|
|
566
|
+
zIndex: 10,
|
|
567
|
+
},
|
|
568
|
+
topBarButtons: {
|
|
569
|
+
height: TOP_BAR_BUTTONS,
|
|
570
|
+
flexDirection: 'row',
|
|
571
|
+
alignItems: 'flex-end',
|
|
572
|
+
paddingBottom: 4,
|
|
573
|
+
// 20 = the collapsed row's 16pt inset + half the difference between
|
|
574
|
+
// the 48pt avatar and these 40pt buttons, so a button's centre line
|
|
575
|
+
// matches the avatar's once the header is collapsed.
|
|
576
|
+
paddingHorizontal: 20,
|
|
577
|
+
},
|
|
578
|
+
roundButton: {
|
|
579
|
+
width: 40,
|
|
580
|
+
height: 40,
|
|
581
|
+
borderRadius: 20,
|
|
582
|
+
backgroundColor: 'rgba(0,0,0,0.28)',
|
|
583
|
+
alignItems: 'center',
|
|
584
|
+
justifyContent: 'center',
|
|
585
|
+
},
|
|
586
|
+
topBarRight: {
|
|
587
|
+
marginLeft: 'auto',
|
|
588
|
+
},
|
|
589
|
+
collapsedTitle: {
|
|
590
|
+
height: TOP_BAR_NAME,
|
|
591
|
+
flexDirection: 'row',
|
|
592
|
+
alignItems: 'center',
|
|
593
|
+
paddingHorizontal: 16,
|
|
594
|
+
gap: 12,
|
|
595
|
+
},
|
|
596
|
+
collapsedAvatar: {
|
|
597
|
+
width: 48,
|
|
598
|
+
height: 48,
|
|
599
|
+
borderRadius: 24,
|
|
600
|
+
overflow: 'hidden',
|
|
601
|
+
backgroundColor: 'rgba(255,255,255,0.2)',
|
|
602
|
+
},
|
|
603
|
+
collapsedAvatarImage: {
|
|
604
|
+
width: '100%',
|
|
605
|
+
height: '100%',
|
|
606
|
+
},
|
|
607
|
+
collapsedInitials: {
|
|
608
|
+
fontSize: 18,
|
|
609
|
+
fontWeight: '600',
|
|
610
|
+
},
|
|
611
|
+
collapsedText: {
|
|
612
|
+
flex: 1,
|
|
613
|
+
},
|
|
614
|
+
collapsedName: {
|
|
615
|
+
color: '#FFFFFF',
|
|
616
|
+
fontSize: 20,
|
|
617
|
+
fontWeight: '600',
|
|
618
|
+
},
|
|
619
|
+
collapsedSubtitle: {
|
|
620
|
+
color: 'rgba(255,255,255,0.8)',
|
|
621
|
+
fontSize: 13,
|
|
622
|
+
marginTop: 1,
|
|
623
|
+
},
|
|
624
|
+
});
|