stream-chat-react-native-core 9.0.0-beta.26 → 9.0.0-beta.28
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/lib/commonjs/components/Attachment/Giphy/Giphy.js +19 -7
- package/lib/commonjs/components/Attachment/Giphy/Giphy.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerContent.js +3 -3
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerContent.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerGenericContent.js +24 -16
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerGenericContent.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +2 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +1 -1
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/useChannelActionItems.js +0 -15
- package/lib/commonjs/components/ChannelList/hooks/useChannelActionItems.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelDetailsBottomSheet.js +15 -13
- package/lib/commonjs/components/ChannelPreview/ChannelDetailsBottomSheet.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +2 -0
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewView.js +1 -0
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewView.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelSwipableWrapper.js +11 -9
- package/lib/commonjs/components/ChannelPreview/ChannelSwipableWrapper.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +5 -4
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingIndicator.js +3 -3
- package/lib/commonjs/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +2 -10
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageContent.js +39 -5
- package/lib/commonjs/components/Message/MessageItemView/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageItemView.js +11 -7
- package/lib/commonjs/components/Message/MessageItemView/MessageItemView.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageReplies.js +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageReplies.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageStatus.js +18 -8
- package/lib/commonjs/components/Message/MessageItemView/MessageStatus.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js +3 -1
- package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js +2 -1
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageUserReactions.js +0 -1
- package/lib/commonjs/components/MessageMenu/MessageUserReactions.js.map +1 -1
- package/lib/commonjs/components/Poll/components/MultipleVotesSettings.js +8 -0
- package/lib/commonjs/components/Poll/components/MultipleVotesSettings.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollInputDialog.js +1 -1
- package/lib/commonjs/components/Poll/components/PollInputDialog.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollOption.js +15 -5
- package/lib/commonjs/components/Poll/components/PollOption.js.map +1 -1
- package/lib/commonjs/components/ThreadList/ThreadList.js +3 -1
- package/lib/commonjs/components/ThreadList/ThreadList.js.map +1 -1
- package/lib/commonjs/components/UIComponents/BottomSheetModal.js +141 -40
- package/lib/commonjs/components/UIComponents/BottomSheetModal.js.map +1 -1
- package/lib/commonjs/components/UIComponents/BottomSheetModal.utils.js +53 -0
- package/lib/commonjs/components/UIComponents/BottomSheetModal.utils.js.map +1 -0
- package/lib/commonjs/components/UIComponents/StreamBottomSheetModalFlatList.js +9 -5
- package/lib/commonjs/components/UIComponents/StreamBottomSheetModalFlatList.js.map +1 -1
- package/lib/commonjs/components/ui/Avatar/ChannelAvatar.js +1 -1
- package/lib/commonjs/components/ui/Avatar/ChannelAvatar.js.map +1 -1
- package/lib/commonjs/components/ui/Button/hooks/useButtonStyles.js +1 -1
- package/lib/commonjs/components/ui/Button/hooks/useButtonStyles.js.map +1 -1
- package/lib/commonjs/contexts/bottomSheetContext/BottomSheetContext.js.map +1 -1
- package/lib/commonjs/contexts/messageComposerContext/MessageComposerContext.js +4 -4
- package/lib/commonjs/contexts/messageComposerContext/MessageComposerContext.js.map +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +1 -0
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/hooks/messagePreview/useMessagePreviewText.js +4 -4
- package/lib/commonjs/hooks/messagePreview/useMessagePreviewText.js.map +1 -1
- package/lib/commonjs/i18n/en.json +3 -2
- package/lib/commonjs/i18n/es.json +3 -2
- package/lib/commonjs/i18n/fr.json +3 -2
- package/lib/commonjs/i18n/he.json +3 -2
- package/lib/commonjs/i18n/hi.json +3 -2
- package/lib/commonjs/i18n/it.json +3 -2
- package/lib/commonjs/i18n/ja.json +3 -2
- package/lib/commonjs/i18n/ko.json +3 -2
- package/lib/commonjs/i18n/nl.json +3 -2
- package/lib/commonjs/i18n/pt-br.json +3 -2
- package/lib/commonjs/i18n/ru.json +3 -2
- package/lib/commonjs/i18n/tr.json +3 -2
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Giphy/Giphy.js +19 -7
- package/lib/module/components/Attachment/Giphy/Giphy.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerContent.js +3 -3
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerContent.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerGenericContent.js +24 -16
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerGenericContent.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +2 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +1 -1
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/useChannelActionItems.js +0 -15
- package/lib/module/components/ChannelList/hooks/useChannelActionItems.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelDetailsBottomSheet.js +15 -13
- package/lib/module/components/ChannelPreview/ChannelDetailsBottomSheet.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +2 -0
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewView.js +1 -0
- package/lib/module/components/ChannelPreview/ChannelPreviewView.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelSwipableWrapper.js +11 -9
- package/lib/module/components/ChannelPreview/ChannelSwipableWrapper.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +5 -4
- package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/module/components/Indicators/LoadingIndicator.js +3 -3
- package/lib/module/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/module/components/Message/Message.js +2 -10
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageContent.js +39 -5
- package/lib/module/components/Message/MessageItemView/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageItemView.js +11 -7
- package/lib/module/components/Message/MessageItemView/MessageItemView.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageReplies.js +1 -1
- package/lib/module/components/Message/MessageItemView/MessageReplies.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageStatus.js +18 -8
- package/lib/module/components/Message/MessageItemView/MessageStatus.js.map +1 -1
- package/lib/module/components/Message/hooks/useCreateMessageContext.js +3 -1
- package/lib/module/components/Message/hooks/useCreateMessageContext.js.map +1 -1
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js +2 -1
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageUserReactions.js +0 -1
- package/lib/module/components/MessageMenu/MessageUserReactions.js.map +1 -1
- package/lib/module/components/Poll/components/MultipleVotesSettings.js +8 -0
- package/lib/module/components/Poll/components/MultipleVotesSettings.js.map +1 -1
- package/lib/module/components/Poll/components/PollInputDialog.js +1 -1
- package/lib/module/components/Poll/components/PollInputDialog.js.map +1 -1
- package/lib/module/components/Poll/components/PollOption.js +15 -5
- package/lib/module/components/Poll/components/PollOption.js.map +1 -1
- package/lib/module/components/ThreadList/ThreadList.js +3 -1
- package/lib/module/components/ThreadList/ThreadList.js.map +1 -1
- package/lib/module/components/UIComponents/BottomSheetModal.js +141 -40
- package/lib/module/components/UIComponents/BottomSheetModal.js.map +1 -1
- package/lib/module/components/UIComponents/BottomSheetModal.utils.js +53 -0
- package/lib/module/components/UIComponents/BottomSheetModal.utils.js.map +1 -0
- package/lib/module/components/UIComponents/StreamBottomSheetModalFlatList.js +9 -5
- package/lib/module/components/UIComponents/StreamBottomSheetModalFlatList.js.map +1 -1
- package/lib/module/components/ui/Avatar/ChannelAvatar.js +1 -1
- package/lib/module/components/ui/Avatar/ChannelAvatar.js.map +1 -1
- package/lib/module/components/ui/Button/hooks/useButtonStyles.js +1 -1
- package/lib/module/components/ui/Button/hooks/useButtonStyles.js.map +1 -1
- package/lib/module/contexts/bottomSheetContext/BottomSheetContext.js.map +1 -1
- package/lib/module/contexts/messageComposerContext/MessageComposerContext.js +4 -4
- package/lib/module/contexts/messageComposerContext/MessageComposerContext.js.map +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +1 -0
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/hooks/messagePreview/useMessagePreviewText.js +4 -4
- package/lib/module/hooks/messagePreview/useMessagePreviewText.js.map +1 -1
- package/lib/module/i18n/en.json +3 -2
- package/lib/module/i18n/es.json +3 -2
- package/lib/module/i18n/fr.json +3 -2
- package/lib/module/i18n/he.json +3 -2
- package/lib/module/i18n/hi.json +3 -2
- package/lib/module/i18n/it.json +3 -2
- package/lib/module/i18n/ja.json +3 -2
- package/lib/module/i18n/ko.json +3 -2
- package/lib/module/i18n/nl.json +3 -2
- package/lib/module/i18n/pt-br.json +3 -2
- package/lib/module/i18n/ru.json +3 -2
- package/lib/module/i18n/tr.json +3 -2
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Giphy/Giphy.d.ts +1 -1
- package/lib/typescript/components/Attachment/Giphy/Giphy.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerGenericContent.d.ts.map +1 -1
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionList.d.ts.map +1 -1
- package/lib/typescript/components/ChannelList/hooks/useChannelActionItems.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelDetailsBottomSheet.d.ts +2 -2
- package/lib/typescript/components/ChannelPreview/ChannelDetailsBottomSheet.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMessage.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreviewStatus.d.ts +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreviewStatus.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreviewView.d.ts +2 -2
- package/lib/typescript/components/ChannelPreview/ChannelPreviewView.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelSwipableWrapper.d.ts +3 -3
- package/lib/typescript/components/ChannelPreview/ChannelSwipableWrapper.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts.map +1 -1
- package/lib/typescript/components/Indicators/LoadingIndicator.d.ts.map +1 -1
- package/lib/typescript/components/Message/Message.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageContent.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageItemView.d.ts +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageItemView.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageStatus.d.ts.map +1 -1
- package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/ShowThreadMessageInChannelButton.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageUserReactions.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/MultipleVotesSettings.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollOption.d.ts.map +1 -1
- package/lib/typescript/components/ThreadList/ThreadList.d.ts.map +1 -1
- package/lib/typescript/components/UIComponents/BottomSheetModal.d.ts +5 -1
- package/lib/typescript/components/UIComponents/BottomSheetModal.d.ts.map +1 -1
- package/lib/typescript/components/UIComponents/BottomSheetModal.utils.d.ts +28 -0
- package/lib/typescript/components/UIComponents/BottomSheetModal.utils.d.ts.map +1 -0
- package/lib/typescript/components/UIComponents/StreamBottomSheetModalFlatList.d.ts.map +1 -1
- package/lib/typescript/components/ui/Avatar/ChannelAvatar.d.ts.map +1 -1
- package/lib/typescript/contexts/bottomSheetContext/BottomSheetContext.d.ts +1 -0
- package/lib/typescript/contexts/bottomSheetContext/BottomSheetContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +4 -2
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts.map +1 -1
- package/lib/typescript/contexts/themeContext/ThemeContext.d.ts +1 -0
- package/lib/typescript/contexts/themeContext/ThemeContext.d.ts.map +1 -1
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +1 -0
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts.map +1 -1
- package/lib/typescript/hooks/messagePreview/useMessagePreviewText.d.ts.map +1 -1
- package/lib/typescript/i18n/en.json +3 -2
- package/lib/typescript/i18n/es.json +3 -2
- package/lib/typescript/i18n/fr.json +3 -2
- package/lib/typescript/i18n/he.json +3 -2
- package/lib/typescript/i18n/hi.json +3 -2
- package/lib/typescript/i18n/it.json +3 -2
- package/lib/typescript/i18n/ja.json +3 -2
- package/lib/typescript/i18n/ko.json +3 -2
- package/lib/typescript/i18n/nl.json +3 -2
- package/lib/typescript/i18n/pt-br.json +3 -2
- package/lib/typescript/i18n/ru.json +3 -2
- package/lib/typescript/i18n/tr.json +3 -2
- package/lib/typescript/utils/i18n/Streami18n.d.ts +3 -2
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Attachment/Giphy/Giphy.tsx +19 -7
- package/src/components/Attachment/__tests__/Giphy.test.js +33 -1
- package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsx +3 -3
- package/src/components/AttachmentPicker/components/AttachmentPickerGenericContent.tsx +23 -13
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionList.tsx +3 -1
- package/src/components/Channel/Channel.tsx +1 -1
- package/src/components/ChannelList/hooks/__tests__/useChannelActionItems.test.tsx +12 -45
- package/src/components/ChannelList/hooks/useChannelActionItems.tsx +1 -19
- package/src/components/ChannelPreview/ChannelDetailsBottomSheet.tsx +10 -8
- package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +3 -1
- package/src/components/ChannelPreview/ChannelPreviewStatus.tsx +1 -1
- package/src/components/ChannelPreview/ChannelPreviewView.tsx +3 -2
- package/src/components/ChannelPreview/ChannelSwipableWrapper.tsx +8 -7
- package/src/components/ChannelPreview/__tests__/ChannelDetailsBottomSheet.test.tsx +1 -1
- package/src/components/ChannelPreview/__tests__/ChannelLastMessagePreview.test.tsx +32 -0
- package/src/components/ChannelPreview/__tests__/ChannelSwipableWrapper.test.tsx +5 -2
- package/src/components/ImageGallery/components/ImageGrid.tsx +3 -1
- package/src/components/Indicators/LoadingIndicator.tsx +7 -5
- package/src/components/Message/Message.tsx +2 -12
- package/src/components/Message/MessageItemView/MessageContent.tsx +44 -7
- package/src/components/Message/MessageItemView/MessageItemView.tsx +15 -7
- package/src/components/Message/MessageItemView/MessageReplies.tsx +1 -1
- package/src/components/Message/MessageItemView/MessageStatus.tsx +16 -5
- package/src/components/Message/MessageItemView/__tests__/MessageContent.test.js +72 -1
- package/src/components/Message/MessageItemView/__tests__/MessageItemView.test.js +52 -1
- package/src/components/Message/hooks/useCreateMessageContext.ts +3 -0
- package/src/components/MessageInput/ShowThreadMessageInChannelButton.tsx +1 -0
- package/src/components/MessageInput/__tests__/__snapshots__/AttachButton.test.js.snap +1 -1
- package/src/components/MessageMenu/MessageUserReactions.tsx +1 -5
- package/src/components/Poll/components/MultipleVotesSettings.tsx +8 -0
- package/src/components/Poll/components/PollInputDialog.tsx +1 -1
- package/src/components/Poll/components/PollOption.tsx +25 -9
- package/src/components/ThreadList/ThreadList.tsx +1 -1
- package/src/components/UIComponents/BottomSheetModal.tsx +237 -53
- package/src/components/UIComponents/BottomSheetModal.utils.ts +82 -0
- package/src/components/UIComponents/StreamBottomSheetModalFlatList.tsx +14 -5
- package/src/components/UIComponents/__tests__/BottomSheetModal.utils.test.ts +111 -0
- package/src/components/ui/Avatar/ChannelAvatar.tsx +5 -1
- package/src/components/ui/Button/hooks/useButtonStyles.ts +1 -1
- package/src/contexts/bottomSheetContext/BottomSheetContext.tsx +1 -0
- package/src/contexts/messageComposerContext/MessageComposerContext.tsx +1 -1
- package/src/contexts/messageContext/MessageContext.tsx +4 -2
- package/src/contexts/themeContext/utils/theme.ts +2 -0
- package/src/hooks/messagePreview/useMessagePreviewText.tsx +5 -6
- package/src/i18n/en.json +3 -2
- package/src/i18n/es.json +3 -2
- package/src/i18n/fr.json +3 -2
- package/src/i18n/he.json +3 -2
- package/src/i18n/hi.json +3 -2
- package/src/i18n/it.json +3 -2
- package/src/i18n/ja.json +3 -2
- package/src/i18n/ko.json +3 -2
- package/src/i18n/nl.json +3 -2
- package/src/i18n/pt-br.json +3 -2
- package/src/i18n/ru.json +3 -2
- package/src/i18n/tr.json +3 -2
- package/src/version.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { Pressable, StyleSheet, View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { ChannelPreviewProps } from './ChannelPreview';
|
|
4
|
+
import type { ChannelPreviewProps } from './ChannelPreview';
|
|
5
5
|
import { ChannelPreviewMessage } from './ChannelPreviewMessage';
|
|
6
6
|
import { ChannelPreviewMutedStatus } from './ChannelPreviewMutedStatus';
|
|
7
7
|
import { ChannelPreviewStatus } from './ChannelPreviewStatus';
|
|
8
8
|
import { ChannelPreviewTitle } from './ChannelPreviewTitle';
|
|
9
9
|
import { ChannelPreviewUnreadCount } from './ChannelPreviewUnreadCount';
|
|
10
10
|
|
|
11
|
-
import { LastMessageType } from './hooks/useChannelPreviewData';
|
|
11
|
+
import type { LastMessageType } from './hooks/useChannelPreviewData';
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
ChannelsContextValue,
|
|
@@ -204,6 +204,7 @@ const useStyles = () => {
|
|
|
204
204
|
},
|
|
205
205
|
contentContainer: { flex: 1, gap: primitives.spacingXxs },
|
|
206
206
|
upperRow: {
|
|
207
|
+
gap: primitives.spacingMd,
|
|
207
208
|
alignItems: 'center',
|
|
208
209
|
flex: 1,
|
|
209
210
|
flexDirection: 'row',
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import React, { PropsWithChildren, useCallback, useMemo, useState } from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { SharedValue } from 'react-native-reanimated';
|
|
4
|
+
import type { SharedValue } from 'react-native-reanimated';
|
|
5
5
|
|
|
6
|
-
import { Channel } from 'stream-chat';
|
|
6
|
+
import type { Channel } from 'stream-chat';
|
|
7
7
|
|
|
8
8
|
import { ChannelDetailsBottomSheet as DefaultChannelDetailsBottomSheet } from './ChannelDetailsBottomSheet';
|
|
9
9
|
import type { ChannelDetailsBottomSheetProps } from './ChannelDetailsBottomSheet';
|
|
10
10
|
import { useIsChannelMuted } from './hooks/useIsChannelMuted';
|
|
11
11
|
|
|
12
|
-
import { useTheme } from '../../contexts';
|
|
13
12
|
import { useSwipeRegistryContext } from '../../contexts/swipeableContext/SwipeRegistryContext';
|
|
13
|
+
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
14
14
|
import { MenuPointHorizontal, Mute, Sound } from '../../icons';
|
|
15
|
-
import { GetChannelActionItems } from '../ChannelList/hooks/useChannelActionItems';
|
|
15
|
+
import type { GetChannelActionItems } from '../ChannelList/hooks/useChannelActionItems';
|
|
16
16
|
import { useChannelActionItems } from '../ChannelList/hooks/useChannelActionItems';
|
|
17
17
|
import { useChannelActions } from '../ChannelList/hooks/useChannelActions';
|
|
18
|
+
import { BottomSheetModal } from '../UIComponents/BottomSheetModal';
|
|
18
19
|
import {
|
|
19
|
-
BottomSheetModal,
|
|
20
20
|
RightActions,
|
|
21
21
|
SwipableActionItem,
|
|
22
22
|
SwipableWrapper,
|
|
23
23
|
SwipableWrapperProps,
|
|
24
|
-
} from '../UIComponents';
|
|
24
|
+
} from '../UIComponents/SwipableWrapper';
|
|
25
25
|
|
|
26
26
|
export const OpenChannelDetailsButton = () => {
|
|
27
27
|
const {
|
|
@@ -120,9 +120,10 @@ export const ChannelSwipableWrapper = ({
|
|
|
120
120
|
{children}
|
|
121
121
|
</SwipableWrapper>
|
|
122
122
|
<BottomSheetModal
|
|
123
|
+
enableDynamicSizing={true}
|
|
123
124
|
onClose={() => setChannelDetailSheetOpen(false)}
|
|
124
125
|
visible={channelDetailSheetOpen}
|
|
125
|
-
height={
|
|
126
|
+
height={424}
|
|
126
127
|
>
|
|
127
128
|
<ChannelDetailsBottomSheetComponent channel={channel} items={sheetItems} />
|
|
128
129
|
</BottomSheetModal>
|
|
@@ -11,7 +11,7 @@ import { ChannelDetailsBottomSheet } from '../ChannelDetailsBottomSheet';
|
|
|
11
11
|
|
|
12
12
|
const mockStreamBottomSheetModalFlatList = jest.fn(() => null);
|
|
13
13
|
|
|
14
|
-
jest.mock('../../UIComponents', () => ({
|
|
14
|
+
jest.mock('../../UIComponents/StreamBottomSheetModalFlatList', () => ({
|
|
15
15
|
StreamBottomSheetModalFlatList: (...args: unknown[]) =>
|
|
16
16
|
mockStreamBottomSheetModalFlatList(...args),
|
|
17
17
|
}));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from '@testing-library/react-native';
|
|
4
|
+
|
|
5
|
+
import { generateGiphyAttachment } from '../../../mock-builders/generator/attachment';
|
|
6
|
+
import { generateMessage } from '../../../mock-builders/generator/message';
|
|
7
|
+
import { generateUser } from '../../../mock-builders/generator/user';
|
|
8
|
+
import { getTestClientWithUser } from '../../../mock-builders/mock';
|
|
9
|
+
import { Chat } from '../../Chat/Chat';
|
|
10
|
+
import { ChannelLastMessagePreview } from '../ChannelLastMessagePreview';
|
|
11
|
+
|
|
12
|
+
describe('ChannelLastMessagePreview', () => {
|
|
13
|
+
it('shows Giphy instead of slash-command text for giphy attachments with quoted replies', async () => {
|
|
14
|
+
const client = await getTestClientWithUser({ id: 'preview-user' });
|
|
15
|
+
const user = generateUser();
|
|
16
|
+
const message = generateMessage({
|
|
17
|
+
attachments: [generateGiphyAttachment()],
|
|
18
|
+
quoted_message: generateMessage({ text: 'quoted message', user }),
|
|
19
|
+
text: '/giphy Cat',
|
|
20
|
+
user,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const { getByText, queryByText } = render(
|
|
24
|
+
<Chat client={client}>
|
|
25
|
+
<ChannelLastMessagePreview message={message} />
|
|
26
|
+
</Chat>,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
expect(getByText('Giphy')).toBeTruthy();
|
|
30
|
+
expect(queryByText('/giphy Cat')).toBeNull();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -31,7 +31,7 @@ const mockSwipableWrapper = jest.fn(
|
|
|
31
31
|
},
|
|
32
32
|
);
|
|
33
33
|
|
|
34
|
-
jest.mock('../../../contexts', () => ({
|
|
34
|
+
jest.mock('../../../contexts/themeContext/ThemeContext', () => ({
|
|
35
35
|
useTheme: () => ({
|
|
36
36
|
theme: {
|
|
37
37
|
semantics: {
|
|
@@ -50,8 +50,11 @@ jest.mock('../../../contexts/swipeableContext/SwipeRegistryContext', () => ({
|
|
|
50
50
|
}),
|
|
51
51
|
}));
|
|
52
52
|
|
|
53
|
-
jest.mock('../../UIComponents', () => ({
|
|
53
|
+
jest.mock('../../UIComponents/BottomSheetModal', () => ({
|
|
54
54
|
BottomSheetModal: ({ children }: React.PropsWithChildren) => <>{children}</>,
|
|
55
|
+
}));
|
|
56
|
+
|
|
57
|
+
jest.mock('../../UIComponents/SwipableWrapper', () => ({
|
|
55
58
|
RightActions: ({ items }: { items: Array<{ action: () => void; id: string }> }) => {
|
|
56
59
|
rightActionsProbe.items = items;
|
|
57
60
|
return null;
|
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
ImageGalleryAsset,
|
|
13
13
|
ImageGalleryState,
|
|
14
14
|
} from '../../../state-store/image-gallery-state-store';
|
|
15
|
+
import { primitives } from '../../../theme';
|
|
15
16
|
import { FileTypes } from '../../../types/types';
|
|
16
17
|
import { StreamBottomSheetModalFlatList } from '../../UIComponents/StreamBottomSheetModalFlatList';
|
|
17
18
|
|
|
@@ -108,8 +109,9 @@ const useStyles = () => {
|
|
|
108
109
|
return StyleSheet.create({
|
|
109
110
|
contentContainer: {
|
|
110
111
|
flexGrow: 1,
|
|
111
|
-
...contentContainer,
|
|
112
112
|
backgroundColor: semantics.backgroundCoreApp,
|
|
113
|
+
marginTop: primitives.spacingSm,
|
|
114
|
+
...contentContainer,
|
|
113
115
|
},
|
|
114
116
|
image: { margin: 1, ...gridImage },
|
|
115
117
|
});
|
|
@@ -6,7 +6,7 @@ import { useTranslationContext } from '../../contexts/translationContext/Transla
|
|
|
6
6
|
import { primitives } from '../../theme';
|
|
7
7
|
import { Spinner } from '../UIComponents/Spinner';
|
|
8
8
|
|
|
9
|
-
type LoadingIndicatorWrapperProps = { text: string };
|
|
9
|
+
type LoadingIndicatorWrapperProps = { text: string | undefined };
|
|
10
10
|
|
|
11
11
|
const LoadingIndicatorWrapper = ({ text }: LoadingIndicatorWrapperProps) => {
|
|
12
12
|
const styles = useStyles();
|
|
@@ -14,9 +14,11 @@ const LoadingIndicatorWrapper = ({ text }: LoadingIndicatorWrapperProps) => {
|
|
|
14
14
|
return (
|
|
15
15
|
<View style={styles.container}>
|
|
16
16
|
<Spinner height={20} width={20} />
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
17
|
+
{text ? (
|
|
18
|
+
<Text style={styles.loadingText} testID='loading'>
|
|
19
|
+
{text}
|
|
20
|
+
</Text>
|
|
21
|
+
) : null}
|
|
20
22
|
</View>
|
|
21
23
|
);
|
|
22
24
|
};
|
|
@@ -44,7 +46,7 @@ export const LoadingIndicator = (props: LoadingProps) => {
|
|
|
44
46
|
case 'message':
|
|
45
47
|
return <LoadingIndicatorWrapper text={t('Loading messages...')} />;
|
|
46
48
|
case 'threads':
|
|
47
|
-
return <LoadingIndicatorWrapper text={
|
|
49
|
+
return <LoadingIndicatorWrapper text={undefined} />;
|
|
48
50
|
default:
|
|
49
51
|
return <LoadingIndicatorWrapper text={t('Loading...')} />;
|
|
50
52
|
}
|
|
@@ -381,21 +381,12 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
383
|
|
|
384
|
-
const onPressQuotedMessage = (quotedMessage: LocalMessage) => {
|
|
385
|
-
if (!goToMessage) {
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
goToMessage(quotedMessage.id);
|
|
390
|
-
};
|
|
391
|
-
|
|
392
384
|
const errorOrFailed = message.type === 'error' || message.status === MessageStatusTypes.FAILED;
|
|
393
385
|
|
|
394
386
|
const onPress = (error = errorOrFailed) => {
|
|
395
387
|
if (dismissKeyboardOnMessageTouch) {
|
|
396
388
|
dismissKeyboard();
|
|
397
389
|
}
|
|
398
|
-
const quotedMessage = message.quoted_message;
|
|
399
390
|
if (error) {
|
|
400
391
|
/**
|
|
401
392
|
* If its a Blocked message, we don't do anything as per specs.
|
|
@@ -411,8 +402,6 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
411
402
|
return;
|
|
412
403
|
}
|
|
413
404
|
showMessageOverlay();
|
|
414
|
-
} else if (quotedMessage) {
|
|
415
|
-
onPressQuotedMessage(quotedMessage);
|
|
416
405
|
}
|
|
417
406
|
};
|
|
418
407
|
|
|
@@ -500,7 +489,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
500
489
|
|
|
501
490
|
const messageContentOrder = messageContentOrderProp.filter((content) => {
|
|
502
491
|
if (content === 'quoted_reply') {
|
|
503
|
-
return !!message.quoted_message;
|
|
492
|
+
return !!message.quoted_message && !hasAttachmentActions;
|
|
504
493
|
}
|
|
505
494
|
|
|
506
495
|
switch (content) {
|
|
@@ -711,6 +700,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
711
700
|
goToMessage,
|
|
712
701
|
groupStyles,
|
|
713
702
|
handleAction,
|
|
703
|
+
hasAttachmentActions,
|
|
714
704
|
handleReaction,
|
|
715
705
|
handleToggleReaction,
|
|
716
706
|
hasReactions,
|
|
@@ -121,6 +121,7 @@ const MessageContentWithContext = (props: MessageContentPropsWithContext) => {
|
|
|
121
121
|
FileAttachmentGroup,
|
|
122
122
|
Gallery,
|
|
123
123
|
groupStyles,
|
|
124
|
+
goToMessage,
|
|
124
125
|
isMessageAIGenerated,
|
|
125
126
|
isMyMessage,
|
|
126
127
|
isVeryLastMessage,
|
|
@@ -221,7 +222,6 @@ const MessageContentWithContext = (props: MessageContentPropsWithContext) => {
|
|
|
221
222
|
|
|
222
223
|
const { setNativeScrollability } = useMessageListItemContext();
|
|
223
224
|
const hasContentSideViews = !!(MessageContentLeadingView || MessageContentTrailingView);
|
|
224
|
-
|
|
225
225
|
const contentBody = (
|
|
226
226
|
<>
|
|
227
227
|
<View
|
|
@@ -240,12 +240,45 @@ const MessageContentWithContext = (props: MessageContentPropsWithContext) => {
|
|
|
240
240
|
case 'quoted_reply':
|
|
241
241
|
return (
|
|
242
242
|
message.quoted_message && (
|
|
243
|
-
<
|
|
243
|
+
<Pressable
|
|
244
|
+
disabled={!goToMessage}
|
|
244
245
|
key={`quoted_reply_${messageContentOrderIndex}`}
|
|
246
|
+
onLongPress={(event) => {
|
|
247
|
+
if (onLongPress) {
|
|
248
|
+
onLongPress({
|
|
249
|
+
emitter: 'messageContent',
|
|
250
|
+
event,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}}
|
|
254
|
+
onPress={(event) => {
|
|
255
|
+
if (!message.quoted_message || !goToMessage) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (onPress) {
|
|
260
|
+
onPress({
|
|
261
|
+
defaultHandler: () => goToMessage(message.quoted_message!.id),
|
|
262
|
+
emitter: 'messageContent',
|
|
263
|
+
event,
|
|
264
|
+
});
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
goToMessage(message.quoted_message.id);
|
|
269
|
+
}}
|
|
270
|
+
onPressIn={(event) => {
|
|
271
|
+
if (onPressIn) {
|
|
272
|
+
onPressIn({
|
|
273
|
+
emitter: 'messageContent',
|
|
274
|
+
event,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}}
|
|
245
278
|
style={[styles.replyContainer, replyContainer]}
|
|
246
279
|
>
|
|
247
280
|
<Reply mode='reply' styles={replyStyles} />
|
|
248
|
-
</
|
|
281
|
+
</Pressable>
|
|
249
282
|
)
|
|
250
283
|
);
|
|
251
284
|
case 'attachments':
|
|
@@ -584,7 +617,8 @@ export const MessageContent = (props: MessageContentProps) => {
|
|
|
584
617
|
const messageHasSingleFile =
|
|
585
618
|
messageContentOrder.length === 1 && messageContentOrder[0] === 'files' && isSingleFile;
|
|
586
619
|
const messageHasOnlyText = messageContentOrder.length === 1 && messageContentOrder[0] === 'text';
|
|
587
|
-
const
|
|
620
|
+
const messageHasStandaloneGiphyOrImgur =
|
|
621
|
+
!message.quoted_message &&
|
|
588
622
|
otherAttachments.filter(
|
|
589
623
|
(file) => file.type === FileTypes.Giphy || file.type === FileTypes.Imgur,
|
|
590
624
|
).length > 0;
|
|
@@ -594,17 +628,20 @@ export const MessageContent = (props: MessageContentProps) => {
|
|
|
594
628
|
messageHasSingleMedia ||
|
|
595
629
|
messageHasSingleFile ||
|
|
596
630
|
messageHasOnlyText ||
|
|
597
|
-
|
|
631
|
+
messageHasStandaloneGiphyOrImgur;
|
|
598
632
|
|
|
599
633
|
const hidePaddingHorizontal =
|
|
600
|
-
messageHasPoll ||
|
|
634
|
+
messageHasPoll ||
|
|
635
|
+
messageHasSingleMedia ||
|
|
636
|
+
messageHasSingleFile ||
|
|
637
|
+
messageHasStandaloneGiphyOrImgur;
|
|
601
638
|
|
|
602
639
|
const hidePaddingBottom =
|
|
603
640
|
messageHasPoll ||
|
|
604
641
|
messageHasSingleMedia ||
|
|
605
642
|
messageHasSingleFile ||
|
|
606
643
|
messageHasOnlyText ||
|
|
607
|
-
|
|
644
|
+
messageHasStandaloneGiphyOrImgur ||
|
|
608
645
|
(messageContentOrder.length > 1 &&
|
|
609
646
|
messageContentOrder[messageContentOrder.length - 1] === 'text');
|
|
610
647
|
|
|
@@ -17,6 +17,7 @@ import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
|
17
17
|
import { useStableCallback } from '../../../hooks/useStableCallback';
|
|
18
18
|
|
|
19
19
|
import { primitives } from '../../../theme';
|
|
20
|
+
import { FileTypes } from '../../../types/types';
|
|
20
21
|
import { checkMessageEquality, checkQuotedMessageEquality } from '../../../utils/utils';
|
|
21
22
|
import { useMessageData } from '../hooks/useMessageData';
|
|
22
23
|
|
|
@@ -199,6 +200,7 @@ export type MessageItemViewPropsWithContext = Pick<
|
|
|
199
200
|
| 'alignment'
|
|
200
201
|
| 'channel'
|
|
201
202
|
| 'groupStyles'
|
|
203
|
+
| 'hasAttachmentActions'
|
|
202
204
|
| 'isMyMessage'
|
|
203
205
|
| 'message'
|
|
204
206
|
| 'onlyEmojis'
|
|
@@ -240,6 +242,7 @@ const MessageItemViewWithContext = (props: MessageItemViewPropsWithContext) => {
|
|
|
240
242
|
enableMessageGroupingByUser,
|
|
241
243
|
enableSwipeToReply,
|
|
242
244
|
groupStyles,
|
|
245
|
+
hasAttachmentActions,
|
|
243
246
|
isMyMessage,
|
|
244
247
|
message,
|
|
245
248
|
MessageAuthor,
|
|
@@ -293,10 +296,15 @@ const MessageItemViewWithContext = (props: MessageItemViewPropsWithContext) => {
|
|
|
293
296
|
});
|
|
294
297
|
|
|
295
298
|
const groupStyle = `${alignment}_${groupStyles?.[0]?.toLowerCase?.()}`;
|
|
299
|
+
const hasVisibleQuotedReply = !!message.quoted_message && !hasAttachmentActions;
|
|
300
|
+
const hasStandaloneGiphyOrImgur =
|
|
301
|
+
!hasVisibleQuotedReply &&
|
|
302
|
+
otherAttachments.length > 0 &&
|
|
303
|
+
(otherAttachments[0].type === FileTypes.Giphy || otherAttachments[0].type === FileTypes.Imgur);
|
|
296
304
|
|
|
297
|
-
let noBorder = onlyEmojis && !
|
|
305
|
+
let noBorder = onlyEmojis && !hasVisibleQuotedReply;
|
|
298
306
|
if (otherAttachments.length) {
|
|
299
|
-
if (
|
|
307
|
+
if (hasStandaloneGiphyOrImgur && !isMyMessage) {
|
|
300
308
|
noBorder = false;
|
|
301
309
|
} else {
|
|
302
310
|
noBorder = true;
|
|
@@ -304,12 +312,10 @@ const MessageItemViewWithContext = (props: MessageItemViewPropsWithContext) => {
|
|
|
304
312
|
}
|
|
305
313
|
|
|
306
314
|
let backgroundColor = semantics.chatBgOutgoing;
|
|
307
|
-
if (onlyEmojis && !
|
|
315
|
+
if (onlyEmojis && !hasVisibleQuotedReply) {
|
|
316
|
+
backgroundColor = 'transparent';
|
|
317
|
+
} else if (hasStandaloneGiphyOrImgur) {
|
|
308
318
|
backgroundColor = 'transparent';
|
|
309
|
-
} else if (otherAttachments.length) {
|
|
310
|
-
if (otherAttachments[0].type === 'giphy') {
|
|
311
|
-
backgroundColor = 'transparent';
|
|
312
|
-
}
|
|
313
319
|
} else if (isMessageReceivedOrErrorType) {
|
|
314
320
|
backgroundColor = semantics.chatBgIncoming;
|
|
315
321
|
}
|
|
@@ -519,6 +525,7 @@ export const MessageItemView = (props: MessageItemViewProps) => {
|
|
|
519
525
|
alignment,
|
|
520
526
|
channel,
|
|
521
527
|
groupStyles,
|
|
528
|
+
hasAttachmentActions,
|
|
522
529
|
isMyMessage,
|
|
523
530
|
message,
|
|
524
531
|
contextMenuAnchorRef,
|
|
@@ -560,6 +567,7 @@ export const MessageItemView = (props: MessageItemViewProps) => {
|
|
|
560
567
|
enableMessageGroupingByUser,
|
|
561
568
|
enableSwipeToReply,
|
|
562
569
|
groupStyles,
|
|
570
|
+
hasAttachmentActions,
|
|
563
571
|
isMyMessage,
|
|
564
572
|
message,
|
|
565
573
|
MessageAuthor,
|
|
@@ -235,7 +235,7 @@ const useStyles = () => {
|
|
|
235
235
|
gap: primitives.spacingXs,
|
|
236
236
|
},
|
|
237
237
|
messageRepliesText: {
|
|
238
|
-
color: shouldUseOverlayStyles ? semantics.textOnAccent : semantics.
|
|
238
|
+
color: shouldUseOverlayStyles ? semantics.textOnAccent : semantics.textLink,
|
|
239
239
|
fontSize: primitives.typographyFontSizeSm,
|
|
240
240
|
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
241
241
|
lineHeight: primitives.typographyLineHeightTight,
|
|
@@ -29,7 +29,6 @@ const MessageStatusWithContext = (props: MessageStatusPropsWithContext) => {
|
|
|
29
29
|
messageItemView: {
|
|
30
30
|
status: { checkAllIcon, checkIcon, container, timeIcon },
|
|
31
31
|
},
|
|
32
|
-
semantics,
|
|
33
32
|
},
|
|
34
33
|
} = useTheme();
|
|
35
34
|
|
|
@@ -54,14 +53,14 @@ const MessageStatusWithContext = (props: MessageStatusPropsWithContext) => {
|
|
|
54
53
|
{read ? (
|
|
55
54
|
<CheckAll
|
|
56
55
|
height={16}
|
|
57
|
-
stroke={
|
|
56
|
+
stroke={styles.readCheck.color}
|
|
58
57
|
width={16}
|
|
59
58
|
accessibilityLabel='Read'
|
|
60
59
|
{...checkAllIcon}
|
|
61
60
|
/>
|
|
62
61
|
) : delivered ? (
|
|
63
62
|
<CheckAll
|
|
64
|
-
stroke={
|
|
63
|
+
stroke={styles.deliveredCheck.color}
|
|
65
64
|
height={16}
|
|
66
65
|
width={16}
|
|
67
66
|
accessibilityLabel='Delivered'
|
|
@@ -69,7 +68,7 @@ const MessageStatusWithContext = (props: MessageStatusPropsWithContext) => {
|
|
|
69
68
|
/>
|
|
70
69
|
) : sending ? (
|
|
71
70
|
<Time
|
|
72
|
-
stroke={
|
|
71
|
+
stroke={styles.sendingCheck.color}
|
|
73
72
|
height={16}
|
|
74
73
|
width={16}
|
|
75
74
|
accessibilityLabel='Sending'
|
|
@@ -77,7 +76,7 @@ const MessageStatusWithContext = (props: MessageStatusPropsWithContext) => {
|
|
|
77
76
|
/>
|
|
78
77
|
) : sent ? (
|
|
79
78
|
<Check
|
|
80
|
-
stroke={
|
|
79
|
+
stroke={styles.sentCheck.color}
|
|
81
80
|
height={16}
|
|
82
81
|
width={16}
|
|
83
82
|
accessibilityLabel='Sent'
|
|
@@ -162,6 +161,18 @@ const useStyles = () => {
|
|
|
162
161
|
flexDirection: 'row',
|
|
163
162
|
gap: primitives.spacingXxs,
|
|
164
163
|
},
|
|
164
|
+
readCheck: {
|
|
165
|
+
color: shouldUseOverlayStyles ? semantics.textOnAccent : semantics.accentPrimary,
|
|
166
|
+
},
|
|
167
|
+
deliveredCheck: {
|
|
168
|
+
color: shouldUseOverlayStyles ? semantics.textOnAccent : semantics.chatTextTimestamp,
|
|
169
|
+
},
|
|
170
|
+
sendingCheck: {
|
|
171
|
+
color: shouldUseOverlayStyles ? semantics.textOnAccent : semantics.chatTextTimestamp,
|
|
172
|
+
},
|
|
173
|
+
sentCheck: {
|
|
174
|
+
color: shouldUseOverlayStyles ? semantics.textOnAccent : semantics.chatTextTimestamp,
|
|
175
|
+
},
|
|
165
176
|
});
|
|
166
177
|
}, [shouldUseOverlayStyles, semantics]);
|
|
167
178
|
};
|
|
@@ -7,7 +7,11 @@ import { ChannelsStateProvider } from '../../../../contexts/channelsStateContext
|
|
|
7
7
|
|
|
8
8
|
import { getOrCreateChannelApi } from '../../../../mock-builders/api/getOrCreateChannel';
|
|
9
9
|
import { useMockedApis } from '../../../../mock-builders/api/useMockedApis';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
generateAttachmentAction,
|
|
12
|
+
generateGiphyAttachment,
|
|
13
|
+
generateVideoAttachment,
|
|
14
|
+
} from '../../../../mock-builders/generator/attachment';
|
|
11
15
|
import { generateChannelResponse } from '../../../../mock-builders/generator/channel';
|
|
12
16
|
import { generateMember } from '../../../../mock-builders/generator/member';
|
|
13
17
|
import { generateMessage } from '../../../../mock-builders/generator/message';
|
|
@@ -326,6 +330,73 @@ describe('MessageContent', () => {
|
|
|
326
330
|
expect(contentContainerStyle.paddingBottom).toBe(0);
|
|
327
331
|
});
|
|
328
332
|
|
|
333
|
+
it('keeps content padding for a quoted reply with a giphy attachment', async () => {
|
|
334
|
+
const user = generateUser();
|
|
335
|
+
const message = generateMessage({
|
|
336
|
+
attachments: [generateGiphyAttachment()],
|
|
337
|
+
quoted_message: generateMessage({ text: 'quoted message', user }),
|
|
338
|
+
text: '',
|
|
339
|
+
user,
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
renderMessage({ message });
|
|
343
|
+
|
|
344
|
+
await waitFor(() => {
|
|
345
|
+
expect(screen.getByTestId('message-content-wrapper')).toBeTruthy();
|
|
346
|
+
expect(screen.getByTestId('giphy-attachment')).toBeTruthy();
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
const giphyAttachment = screen.getByTestId('giphy-attachment');
|
|
350
|
+
let ancestor = giphyAttachment.parent;
|
|
351
|
+
let contentContainerStyle;
|
|
352
|
+
|
|
353
|
+
while (ancestor && !contentContainerStyle) {
|
|
354
|
+
const flattenedStyle = StyleSheet.flatten(ancestor.props.style);
|
|
355
|
+
if (
|
|
356
|
+
flattenedStyle &&
|
|
357
|
+
'paddingTop' in flattenedStyle &&
|
|
358
|
+
'paddingHorizontal' in flattenedStyle &&
|
|
359
|
+
'paddingBottom' in flattenedStyle
|
|
360
|
+
) {
|
|
361
|
+
contentContainerStyle = flattenedStyle;
|
|
362
|
+
break;
|
|
363
|
+
}
|
|
364
|
+
ancestor = ancestor.parent;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
expect(contentContainerStyle).toBeTruthy();
|
|
368
|
+
expect(contentContainerStyle.paddingTop).toBeGreaterThan(0);
|
|
369
|
+
expect(contentContainerStyle.paddingHorizontal).toBeGreaterThan(0);
|
|
370
|
+
expect(contentContainerStyle.paddingBottom).toBeGreaterThan(0);
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
it('does not render the quoted reply for an ephemeral giphy preview', async () => {
|
|
374
|
+
const user = generateUser();
|
|
375
|
+
const message = generateMessage({
|
|
376
|
+
attachments: [
|
|
377
|
+
{
|
|
378
|
+
...generateGiphyAttachment(),
|
|
379
|
+
actions: [
|
|
380
|
+
generateAttachmentAction(),
|
|
381
|
+
generateAttachmentAction(),
|
|
382
|
+
generateAttachmentAction(),
|
|
383
|
+
],
|
|
384
|
+
},
|
|
385
|
+
],
|
|
386
|
+
quoted_message: generateMessage({ text: 'quoted message', user }),
|
|
387
|
+
text: '',
|
|
388
|
+
user,
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
renderMessage({ message });
|
|
392
|
+
|
|
393
|
+
await waitFor(() => {
|
|
394
|
+
expect(screen.getByTestId('giphy-action-attachment')).toBeTruthy();
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
expect(screen.queryByText('quoted message')).toBeFalsy();
|
|
398
|
+
});
|
|
399
|
+
|
|
329
400
|
it('renders the FileAttachment component when a file attachment exists', async () => {
|
|
330
401
|
const user = generateUser();
|
|
331
402
|
const message = generateMessage({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { Text } from 'react-native';
|
|
3
|
+
import { StyleSheet, Text } from 'react-native';
|
|
4
4
|
import { GestureDetector } from 'react-native-gesture-handler';
|
|
5
5
|
|
|
6
6
|
import { cleanup, render, screen, waitFor } from '@testing-library/react-native';
|
|
@@ -10,6 +10,10 @@ import { useMessageContext } from '../../../../contexts/messageContext/MessageCo
|
|
|
10
10
|
|
|
11
11
|
import { getOrCreateChannelApi } from '../../../../mock-builders/api/getOrCreateChannel';
|
|
12
12
|
import { useMockedApis } from '../../../../mock-builders/api/useMockedApis';
|
|
13
|
+
import {
|
|
14
|
+
generateAttachmentAction,
|
|
15
|
+
generateGiphyAttachment,
|
|
16
|
+
} from '../../../../mock-builders/generator/attachment';
|
|
13
17
|
import { generateChannelResponse } from '../../../../mock-builders/generator/channel';
|
|
14
18
|
import { generateMember } from '../../../../mock-builders/generator/member';
|
|
15
19
|
import { generateMessage } from '../../../../mock-builders/generator/message';
|
|
@@ -256,4 +260,51 @@ describe('MessageItemView', () => {
|
|
|
256
260
|
});
|
|
257
261
|
});
|
|
258
262
|
});
|
|
263
|
+
|
|
264
|
+
it('keeps the message shell background for a quoted reply with a giphy attachment', async () => {
|
|
265
|
+
const user = generateUser();
|
|
266
|
+
const message = generateMessage({
|
|
267
|
+
attachments: [generateGiphyAttachment()],
|
|
268
|
+
quoted_message: generateMessage({ text: 'quoted message', user }),
|
|
269
|
+
text: '',
|
|
270
|
+
user,
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
renderMessage({ message });
|
|
274
|
+
|
|
275
|
+
await waitFor(() => {
|
|
276
|
+
const wrapperStyle = StyleSheet.flatten(
|
|
277
|
+
screen.getByTestId('message-content-wrapper').props.style,
|
|
278
|
+
);
|
|
279
|
+
expect(wrapperStyle.backgroundColor).not.toBe('transparent');
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it('renders a standalone shell for an ephemeral giphy preview with a quoted reply', async () => {
|
|
284
|
+
const user = generateUser();
|
|
285
|
+
const message = generateMessage({
|
|
286
|
+
attachments: [
|
|
287
|
+
{
|
|
288
|
+
...generateGiphyAttachment(),
|
|
289
|
+
actions: [
|
|
290
|
+
generateAttachmentAction(),
|
|
291
|
+
generateAttachmentAction(),
|
|
292
|
+
generateAttachmentAction(),
|
|
293
|
+
],
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
quoted_message: generateMessage({ text: 'quoted message', user }),
|
|
297
|
+
text: '',
|
|
298
|
+
user,
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
renderMessage({ message });
|
|
302
|
+
|
|
303
|
+
await waitFor(() => {
|
|
304
|
+
const wrapperStyle = StyleSheet.flatten(
|
|
305
|
+
screen.getByTestId('message-content-wrapper').props.style,
|
|
306
|
+
);
|
|
307
|
+
expect(wrapperStyle.backgroundColor).toBe('transparent');
|
|
308
|
+
});
|
|
309
|
+
});
|
|
259
310
|
});
|
|
@@ -25,6 +25,7 @@ export const useCreateMessageContext = ({
|
|
|
25
25
|
goToMessage,
|
|
26
26
|
groupStyles,
|
|
27
27
|
handleAction,
|
|
28
|
+
hasAttachmentActions,
|
|
28
29
|
handleReaction,
|
|
29
30
|
handleToggleReaction,
|
|
30
31
|
hasReactions,
|
|
@@ -79,6 +80,7 @@ export const useCreateMessageContext = ({
|
|
|
79
80
|
goToMessage,
|
|
80
81
|
groupStyles: stableGroupStyles,
|
|
81
82
|
handleAction,
|
|
83
|
+
hasAttachmentActions,
|
|
82
84
|
handleReaction,
|
|
83
85
|
handleToggleReaction,
|
|
84
86
|
hasReactions,
|
|
@@ -116,6 +118,7 @@ export const useCreateMessageContext = ({
|
|
|
116
118
|
alignment,
|
|
117
119
|
goToMessage,
|
|
118
120
|
stableGroupStyles,
|
|
121
|
+
hasAttachmentActions,
|
|
119
122
|
hasReactions,
|
|
120
123
|
messageHasOnlySingleAttachment,
|
|
121
124
|
lastGroupMessage,
|