stream-chat-react-native-core 9.0.0-beta.27 → 9.0.0-beta.29
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/Gallery.js +29 -9
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy/GiphyImage.js +4 -4
- package/lib/commonjs/components/Attachment/Giphy/GiphyImage.js.map +1 -1
- package/lib/commonjs/components/Attachment/ImageLoadingFailedIndicator.js +3 -3
- package/lib/commonjs/components/Attachment/ImageLoadingFailedIndicator.js.map +1 -1
- package/lib/commonjs/components/Attachment/ImageLoadingIndicator.js +1 -1
- package/lib/commonjs/components/Attachment/ImageLoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +2 -2
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.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/Skeleton.js +1 -1
- package/lib/commonjs/components/ChannelList/Skeleton.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 +14 -12
- package/lib/commonjs/components/ChannelPreview/ChannelDetailsBottomSheet.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/ImageGallery.js +3 -3
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +2 -1
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageItemView.js +7 -3
- package/lib/commonjs/components/Message/MessageItemView/MessageItemView.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/components/AttachmentPreview/ImageAttachmentUploadPreview.js +1 -1
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.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/PollInputDialog.js +1 -1
- package/lib/commonjs/components/Poll/components/PollInputDialog.js.map +1 -1
- package/lib/commonjs/components/Reply/Reply.js +2 -2
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/ThreadList/ThreadListItemSkeleton.js +1 -1
- package/lib/commonjs/components/ThreadList/ThreadListItemSkeleton.js.map +1 -1
- package/lib/commonjs/components/UIComponents/BottomSheetModal.js +145 -44
- 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/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/overlayContext/ClosingPortalHostsLayer.js +10 -1
- package/lib/commonjs/contexts/overlayContext/ClosingPortalHostsLayer.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/MessageOverlayHostLayer.js +16 -7
- package/lib/commonjs/contexts/overlayContext/MessageOverlayHostLayer.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/version.json +1 -1
- package/lib/module/components/Attachment/Gallery.js +29 -9
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/Giphy/GiphyImage.js +4 -4
- package/lib/module/components/Attachment/Giphy/GiphyImage.js.map +1 -1
- package/lib/module/components/Attachment/ImageLoadingFailedIndicator.js +3 -3
- package/lib/module/components/Attachment/ImageLoadingFailedIndicator.js.map +1 -1
- package/lib/module/components/Attachment/ImageLoadingIndicator.js +1 -1
- package/lib/module/components/Attachment/ImageLoadingIndicator.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +2 -2
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.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/Skeleton.js +1 -1
- package/lib/module/components/ChannelList/Skeleton.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 +14 -12
- package/lib/module/components/ChannelPreview/ChannelDetailsBottomSheet.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/ImageGallery.js +3 -3
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/Message/Message.js +2 -1
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageItemView.js +7 -3
- package/lib/module/components/Message/MessageItemView/MessageItemView.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/components/AttachmentPreview/ImageAttachmentUploadPreview.js +1 -1
- package/lib/module/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.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/PollInputDialog.js +1 -1
- package/lib/module/components/Poll/components/PollInputDialog.js.map +1 -1
- package/lib/module/components/Reply/Reply.js +2 -2
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/ThreadList/ThreadListItemSkeleton.js +1 -1
- package/lib/module/components/ThreadList/ThreadListItemSkeleton.js.map +1 -1
- package/lib/module/components/UIComponents/BottomSheetModal.js +145 -44
- 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/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/overlayContext/ClosingPortalHostsLayer.js +10 -1
- package/lib/module/contexts/overlayContext/ClosingPortalHostsLayer.js.map +1 -1
- package/lib/module/contexts/overlayContext/MessageOverlayHostLayer.js +16 -7
- package/lib/module/contexts/overlayContext/MessageOverlayHostLayer.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/version.json +1 -1
- package/lib/typescript/components/Attachment/Giphy/GiphyImage.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/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/Message/Message.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/hooks/useCreateMessageContext.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageUserReactions.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/overlayContext/MessageOverlayHostLayer.d.ts.map +1 -1
- package/lib/typescript/hooks/messagePreview/useMessagePreviewText.d.ts.map +1 -1
- package/package.json +2 -4
- package/src/components/Attachment/Gallery.tsx +21 -5
- package/src/components/Attachment/Giphy/GiphyImage.tsx +6 -3
- package/src/components/Attachment/ImageLoadingFailedIndicator.tsx +1 -2
- package/src/components/Attachment/ImageLoadingIndicator.tsx +1 -1
- package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx +2 -2
- package/src/components/Channel/Channel.tsx +1 -1
- package/src/components/ChannelList/Skeleton.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 +9 -7
- 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/ImageGallery.tsx +3 -3
- package/src/components/Message/Message.tsx +2 -1
- package/src/components/Message/MessageItemView/MessageItemView.tsx +8 -3
- package/src/components/Message/MessageItemView/__tests__/MessageContent.test.js +28 -0
- package/src/components/Message/MessageItemView/__tests__/MessageItemView.test.js +32 -1
- package/src/components/Message/hooks/useCreateMessageContext.ts +3 -0
- package/src/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.tsx +1 -1
- package/src/components/MessageMenu/MessageUserReactions.tsx +1 -5
- package/src/components/Poll/components/PollInputDialog.tsx +1 -1
- package/src/components/Reply/Reply.tsx +2 -2
- package/src/components/ThreadList/ThreadListItemSkeleton.tsx +1 -1
- package/src/components/UIComponents/BottomSheetModal.tsx +242 -56
- 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/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/overlayContext/ClosingPortalHostsLayer.tsx +11 -1
- package/src/contexts/overlayContext/MessageOverlayHostLayer.tsx +17 -10
- package/src/hooks/messagePreview/useMessagePreviewText.tsx +5 -6
- package/src/version.json +1 -1
- package/bin/patch-bottom-sheet-5.1.8-pr-2561.js +0 -246
|
@@ -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;
|
|
@@ -279,11 +279,11 @@ export const ImageGalleryWithContext = (props: ImageGalleryWithContextProps) =>
|
|
|
279
279
|
<Animated.View
|
|
280
280
|
accessibilityLabel='Image Gallery'
|
|
281
281
|
pointerEvents={'auto'}
|
|
282
|
-
style={[StyleSheet.
|
|
282
|
+
style={[StyleSheet.absoluteFill, showScreenStyle]}
|
|
283
283
|
>
|
|
284
|
-
<Animated.View style={[StyleSheet.
|
|
284
|
+
<Animated.View style={[StyleSheet.absoluteFill, containerBackground]} />
|
|
285
285
|
<GestureDetector gesture={Gesture.Simultaneous(singleTap, doubleTap, pinch, pan)}>
|
|
286
|
-
<Animated.View style={StyleSheet.
|
|
286
|
+
<Animated.View style={StyleSheet.absoluteFill}>
|
|
287
287
|
<Animated.View
|
|
288
288
|
testID='image-gallery-pager'
|
|
289
289
|
style={[styles.animatedContainer, pagerStyle, pager]}
|
|
@@ -489,7 +489,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
489
489
|
|
|
490
490
|
const messageContentOrder = messageContentOrderProp.filter((content) => {
|
|
491
491
|
if (content === 'quoted_reply') {
|
|
492
|
-
return !!message.quoted_message;
|
|
492
|
+
return !!message.quoted_message && !hasAttachmentActions;
|
|
493
493
|
}
|
|
494
494
|
|
|
495
495
|
switch (content) {
|
|
@@ -700,6 +700,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
700
700
|
goToMessage,
|
|
701
701
|
groupStyles,
|
|
702
702
|
handleAction,
|
|
703
|
+
hasAttachmentActions,
|
|
703
704
|
handleReaction,
|
|
704
705
|
handleToggleReaction,
|
|
705
706
|
hasReactions,
|
|
@@ -200,6 +200,7 @@ export type MessageItemViewPropsWithContext = Pick<
|
|
|
200
200
|
| 'alignment'
|
|
201
201
|
| 'channel'
|
|
202
202
|
| 'groupStyles'
|
|
203
|
+
| 'hasAttachmentActions'
|
|
203
204
|
| 'isMyMessage'
|
|
204
205
|
| 'message'
|
|
205
206
|
| 'onlyEmojis'
|
|
@@ -241,6 +242,7 @@ const MessageItemViewWithContext = (props: MessageItemViewPropsWithContext) => {
|
|
|
241
242
|
enableMessageGroupingByUser,
|
|
242
243
|
enableSwipeToReply,
|
|
243
244
|
groupStyles,
|
|
245
|
+
hasAttachmentActions,
|
|
244
246
|
isMyMessage,
|
|
245
247
|
message,
|
|
246
248
|
MessageAuthor,
|
|
@@ -294,12 +296,13 @@ const MessageItemViewWithContext = (props: MessageItemViewPropsWithContext) => {
|
|
|
294
296
|
});
|
|
295
297
|
|
|
296
298
|
const groupStyle = `${alignment}_${groupStyles?.[0]?.toLowerCase?.()}`;
|
|
299
|
+
const hasVisibleQuotedReply = !!message.quoted_message && !hasAttachmentActions;
|
|
297
300
|
const hasStandaloneGiphyOrImgur =
|
|
298
|
-
!
|
|
301
|
+
!hasVisibleQuotedReply &&
|
|
299
302
|
otherAttachments.length > 0 &&
|
|
300
303
|
(otherAttachments[0].type === FileTypes.Giphy || otherAttachments[0].type === FileTypes.Imgur);
|
|
301
304
|
|
|
302
|
-
let noBorder = onlyEmojis && !
|
|
305
|
+
let noBorder = onlyEmojis && !hasVisibleQuotedReply;
|
|
303
306
|
if (otherAttachments.length) {
|
|
304
307
|
if (hasStandaloneGiphyOrImgur && !isMyMessage) {
|
|
305
308
|
noBorder = false;
|
|
@@ -309,7 +312,7 @@ const MessageItemViewWithContext = (props: MessageItemViewPropsWithContext) => {
|
|
|
309
312
|
}
|
|
310
313
|
|
|
311
314
|
let backgroundColor = semantics.chatBgOutgoing;
|
|
312
|
-
if (onlyEmojis && !
|
|
315
|
+
if (onlyEmojis && !hasVisibleQuotedReply) {
|
|
313
316
|
backgroundColor = 'transparent';
|
|
314
317
|
} else if (hasStandaloneGiphyOrImgur) {
|
|
315
318
|
backgroundColor = 'transparent';
|
|
@@ -522,6 +525,7 @@ export const MessageItemView = (props: MessageItemViewProps) => {
|
|
|
522
525
|
alignment,
|
|
523
526
|
channel,
|
|
524
527
|
groupStyles,
|
|
528
|
+
hasAttachmentActions,
|
|
525
529
|
isMyMessage,
|
|
526
530
|
message,
|
|
527
531
|
contextMenuAnchorRef,
|
|
@@ -563,6 +567,7 @@ export const MessageItemView = (props: MessageItemViewProps) => {
|
|
|
563
567
|
enableMessageGroupingByUser,
|
|
564
568
|
enableSwipeToReply,
|
|
565
569
|
groupStyles,
|
|
570
|
+
hasAttachmentActions,
|
|
566
571
|
isMyMessage,
|
|
567
572
|
message,
|
|
568
573
|
MessageAuthor,
|
|
@@ -8,6 +8,7 @@ import { ChannelsStateProvider } from '../../../../contexts/channelsStateContext
|
|
|
8
8
|
import { getOrCreateChannelApi } from '../../../../mock-builders/api/getOrCreateChannel';
|
|
9
9
|
import { useMockedApis } from '../../../../mock-builders/api/useMockedApis';
|
|
10
10
|
import {
|
|
11
|
+
generateAttachmentAction,
|
|
11
12
|
generateGiphyAttachment,
|
|
12
13
|
generateVideoAttachment,
|
|
13
14
|
} from '../../../../mock-builders/generator/attachment';
|
|
@@ -369,6 +370,33 @@ describe('MessageContent', () => {
|
|
|
369
370
|
expect(contentContainerStyle.paddingBottom).toBeGreaterThan(0);
|
|
370
371
|
});
|
|
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
|
+
|
|
372
400
|
it('renders the FileAttachment component when a file attachment exists', async () => {
|
|
373
401
|
const user = generateUser();
|
|
374
402
|
const message = generateMessage({
|
|
@@ -10,7 +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 {
|
|
13
|
+
import {
|
|
14
|
+
generateAttachmentAction,
|
|
15
|
+
generateGiphyAttachment,
|
|
16
|
+
} from '../../../../mock-builders/generator/attachment';
|
|
14
17
|
import { generateChannelResponse } from '../../../../mock-builders/generator/channel';
|
|
15
18
|
import { generateMember } from '../../../../mock-builders/generator/member';
|
|
16
19
|
import { generateMessage } from '../../../../mock-builders/generator/message';
|
|
@@ -276,4 +279,32 @@ describe('MessageItemView', () => {
|
|
|
276
279
|
expect(wrapperStyle.backgroundColor).not.toBe('transparent');
|
|
277
280
|
});
|
|
278
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
|
+
});
|
|
279
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,
|
package/src/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.tsx
CHANGED
|
@@ -66,7 +66,7 @@ export const ImageAttachmentUploadPreview = ({
|
|
|
66
66
|
onError={onErrorHandler}
|
|
67
67
|
onLoadEnd={onLoadEndHandler}
|
|
68
68
|
source={{ uri: attachment.localMetadata.previewUri ?? attachment.image_url }}
|
|
69
|
-
style={StyleSheet.
|
|
69
|
+
style={StyleSheet.absoluteFill}
|
|
70
70
|
testID={'image-attachment-upload-preview-image'}
|
|
71
71
|
/>
|
|
72
72
|
{indicatorType === ProgressIndicatorTypes.IN_PROGRESS && <ImageUploadInProgressIndicator />}
|
|
@@ -280,11 +280,7 @@ export const MessageUserReactions = (props: MessageUserReactionsProps) => {
|
|
|
280
280
|
<EmojiPickerList onSelectReaction={handleSelectReaction} renderFullInitially={false} />
|
|
281
281
|
</Animated.View>
|
|
282
282
|
) : (
|
|
283
|
-
<Animated.View
|
|
284
|
-
key={'reaction-details'}
|
|
285
|
-
entering={FadeIn.duration(200)}
|
|
286
|
-
exiting={FadeOut.duration(200)}
|
|
287
|
-
>
|
|
283
|
+
<Animated.View key={'reaction-details'} exiting={FadeOut.duration(200)}>
|
|
288
284
|
<Text style={[styles.reactionsText, reactionsText]}>
|
|
289
285
|
{t('{{count}} Reactions', { count: totalReactionCount })}
|
|
290
286
|
</Text>
|
|
@@ -51,7 +51,7 @@ const RightContent = React.memo(
|
|
|
51
51
|
) {
|
|
52
52
|
return (
|
|
53
53
|
<View style={[styles.contentWrapper, styles.contentBorder]}>
|
|
54
|
-
<ImageComponent source={{ uri }} style={StyleSheet.
|
|
54
|
+
<ImageComponent source={{ uri }} style={StyleSheet.absoluteFill} />
|
|
55
55
|
</View>
|
|
56
56
|
);
|
|
57
57
|
}
|
|
@@ -59,7 +59,7 @@ const RightContent = React.memo(
|
|
|
59
59
|
return (
|
|
60
60
|
<View style={[styles.contentWrapper, styles.contentBorder]}>
|
|
61
61
|
<View style={styles.attachmentContainer}>
|
|
62
|
-
<Image source={{ uri: attachment.thumb_url }} style={StyleSheet.
|
|
62
|
+
<Image source={{ uri: attachment.thumb_url }} style={StyleSheet.absoluteFill} />
|
|
63
63
|
<VideoPlayIndicator size='sm' />
|
|
64
64
|
</View>
|
|
65
65
|
</View>
|
|
@@ -19,7 +19,7 @@ const SkeletonBlock = ({ style }: { style: React.ComponentProps<typeof View>['st
|
|
|
19
19
|
baseColor={semantics.backgroundCoreSurfaceDefault}
|
|
20
20
|
duration={animationTime}
|
|
21
21
|
gradientColor={semantics.skeletonLoadingHighlight}
|
|
22
|
-
style={StyleSheet.
|
|
22
|
+
style={StyleSheet.absoluteFill}
|
|
23
23
|
/>
|
|
24
24
|
</View>
|
|
25
25
|
);
|