Skip to content

Commit 004ab9b

Browse files
authored
Merge pull request #3074 from GetStream/develop
Next Release v6
2 parents 1cc008c + 7199f39 commit 004ab9b

File tree

25 files changed

+94
-24
lines changed

25 files changed

+94
-24
lines changed

examples/SampleApp/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7530,10 +7530,10 @@ statuses@~1.5.0:
75307530
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
75317531
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
75327532

7533-
stream-chat-react-native-core@6.6.8:
7534-
version "6.6.8"
7535-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.6.8.tgz#483ade63ba051426480ab2dfd8ab3b248b90ae88"
7536-
integrity sha512-F8S70DHaiit6BEdKOkSMHq2bjMONhrouvJ+szBQuE430EJDgUlc2VErHk3yJCzqIt5lwfVZktjHuqSIOGVg5LQ==
7533+
stream-chat-react-native-core@6.7.3:
7534+
version "6.7.3"
7535+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.7.3.tgz#7e213c03a7414c85ec4ba9da247d9703878ab520"
7536+
integrity sha512-dYoYkVah7l4bmkI0vl7Ma6qD+xjsmeFWOdz7EVwbtR+B3HPMsgz8eRAmBj/p2xcSANxh1bPRD0iLlvD30vXyzg==
75377537
dependencies:
75387538
"@gorhom/bottom-sheet" "^5.1.1"
75397539
dayjs "1.10.5"

package/expo-package/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4733,10 +4733,10 @@ [email protected], stream-buffers@~2.2.0:
47334733
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
47344734
integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==
47354735

4736-
4737-
version "6.7.2"
4738-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.7.2.tgz#955e048b80c55175db084ccbb8519f52ef4bb00c"
4739-
integrity sha512-WJFOCfQ7Xpn8Lr4AE6hUh4Qhrn1eGzsoAcKmL8eSoB/etxdNllOyZ3zrwvZgyy+KIEg9bcX4y+3OWtdKW6qfsA==
4736+
4737+
version "6.7.3"
4738+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.7.3.tgz#7e213c03a7414c85ec4ba9da247d9703878ab520"
4739+
integrity sha512-dYoYkVah7l4bmkI0vl7Ma6qD+xjsmeFWOdz7EVwbtR+B3HPMsgz8eRAmBj/p2xcSANxh1bPRD0iLlvD30vXyzg==
47404740
dependencies:
47414741
"@gorhom/bottom-sheet" "^5.1.1"
47424742
dayjs "1.10.5"

package/native-package/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3409,10 +3409,10 @@ statuses@~1.5.0:
34093409
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
34103410
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
34113411

3412-
3413-
version "6.7.2"
3414-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.7.2.tgz#955e048b80c55175db084ccbb8519f52ef4bb00c"
3415-
integrity sha512-WJFOCfQ7Xpn8Lr4AE6hUh4Qhrn1eGzsoAcKmL8eSoB/etxdNllOyZ3zrwvZgyy+KIEg9bcX4y+3OWtdKW6qfsA==
3412+
3413+
version "6.7.3"
3414+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.7.3.tgz#7e213c03a7414c85ec4ba9da247d9703878ab520"
3415+
integrity sha512-dYoYkVah7l4bmkI0vl7Ma6qD+xjsmeFWOdz7EVwbtR+B3HPMsgz8eRAmBj/p2xcSANxh1bPRD0iLlvD30vXyzg==
34163416
dependencies:
34173417
"@gorhom/bottom-sheet" "^5.1.1"
34183418
dayjs "1.10.5"

package/src/components/Attachment/Gallery.tsx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Pressable, StyleSheet, Text, View } from 'react-native';
44
import type { Attachment } from 'stream-chat';
55

66
import { GalleryImage } from './GalleryImage';
7-
import { ImageReloadIndicator } from './ImageReloadIndicator';
87
import { buildGallery } from './utils/buildGallery/buildGallery';
98

109
import type { Thumbnail } from './utils/buildGallery/types';
@@ -13,6 +12,7 @@ import { getGalleryImageBorderRadius } from './utils/getGalleryImageBorderRadius
1312
import { openUrlSafely } from './utils/openUrlSafely';
1413

1514
import type { MessageType } from '../../components/MessageList/hooks/useMessageList';
15+
import { useTranslationContext } from '../../contexts';
1616
import { useChatConfigContext } from '../../contexts/chatConfigContext/ChatConfigContext';
1717
import {
1818
ImageGalleryContextValue,
@@ -58,6 +58,7 @@ export type GalleryPropsWithContext<
5858
| 'VideoThumbnail'
5959
| 'ImageLoadingIndicator'
6060
| 'ImageLoadingFailedIndicator'
61+
| 'ImageReloadIndicator'
6162
| 'myMessageTheme'
6263
> &
6364
Pick<OverlayContextValue, 'setOverlay'> & {
@@ -90,6 +91,7 @@ const GalleryWithContext = <
9091
hasThreadReplies,
9192
ImageLoadingFailedIndicator,
9293
ImageLoadingIndicator,
94+
ImageReloadIndicator,
9395
images,
9496
legacyImageViewerSwipeBehaviour,
9597
message,
@@ -207,6 +209,7 @@ const GalleryWithContext = <
207209
colIndex={colIndex}
208210
ImageLoadingFailedIndicator={ImageLoadingFailedIndicator}
209211
ImageLoadingIndicator={ImageLoadingIndicator}
212+
ImageReloadIndicator={ImageReloadIndicator}
210213
imagesAndVideos={imagesAndVideos}
211214
invertedDirections={invertedDirections || false}
212215
key={rowIndex}
@@ -258,6 +261,7 @@ type GalleryThumbnailProps<
258261
| 'VideoThumbnail'
259262
| 'ImageLoadingIndicator'
260263
| 'ImageLoadingFailedIndicator'
264+
| 'ImageReloadIndicator'
261265
> &
262266
Pick<ImageGalleryContextValue<StreamChatGenerics>, 'setSelectedMessage' | 'setMessages'> &
263267
Pick<
@@ -274,6 +278,7 @@ const GalleryThumbnail = <
274278
colIndex,
275279
ImageLoadingFailedIndicator,
276280
ImageLoadingIndicator,
281+
ImageReloadIndicator,
277282
imagesAndVideos,
278283
invertedDirections,
279284
legacyImageViewerSwipeBehaviour,
@@ -306,6 +311,7 @@ const GalleryThumbnail = <
306311
},
307312
},
308313
} = useTheme();
314+
const { t } = useTranslationContext();
309315

310316
const openImageViewer = () => {
311317
if (!legacyImageViewerSwipeBehaviour && message) {
@@ -397,6 +403,7 @@ const GalleryThumbnail = <
397403
borderRadius={imageBorderRadius ?? borderRadius}
398404
ImageLoadingFailedIndicator={ImageLoadingFailedIndicator}
399405
ImageLoadingIndicator={ImageLoadingIndicator}
406+
ImageReloadIndicator={ImageReloadIndicator}
400407
thumbnail={thumbnail}
401408
/>
402409
</View>
@@ -411,7 +418,7 @@ const GalleryThumbnail = <
411418
]}
412419
>
413420
<Text style={[styles.moreImagesText, moreImagesText]}>
414-
{`+${imagesAndVideos.length - 4}`}
421+
{String(t('+{{count}}', { count: imagesAndVideos.length - 4 }))}
415422
</Text>
416423
</View>
417424
) : null}
@@ -425,10 +432,15 @@ const GalleryImageThumbnail = <
425432
borderRadius,
426433
ImageLoadingFailedIndicator,
427434
ImageLoadingIndicator,
435+
ImageReloadIndicator,
428436
thumbnail,
429437
}: Pick<
430438
GalleryThumbnailProps<StreamChatGenerics>,
431-
'ImageLoadingFailedIndicator' | 'ImageLoadingIndicator' | 'thumbnail' | 'borderRadius'
439+
| 'ImageLoadingFailedIndicator'
440+
| 'ImageLoadingIndicator'
441+
| 'ImageReloadIndicator'
442+
| 'thumbnail'
443+
| 'borderRadius'
432444
>) => {
433445
const {
434446
isLoadingImage,
@@ -585,6 +597,7 @@ export const Gallery = <
585597
hasThreadReplies,
586598
ImageLoadingFailedIndicator: PropImageLoadingFailedIndicator,
587599
ImageLoadingIndicator: PropImageLoadingIndicator,
600+
ImageReloadIndicator: PropImageReloadIndicator,
588601
images: propImages,
589602
message: propMessage,
590603
myMessageTheme: propMyMessageTheme,
@@ -617,6 +630,7 @@ export const Gallery = <
617630
additionalPressableProps: contextAdditionalPressableProps,
618631
ImageLoadingFailedIndicator: ContextImageLoadingFailedIndicator,
619632
ImageLoadingIndicator: ContextImageLoadingIndicator,
633+
ImageReloadIndicator: ContextImageReloadIndicator,
620634
legacyImageViewerSwipeBehaviour,
621635
myMessageTheme: contextMyMessageTheme,
622636
VideoThumbnail: ContextVideoThumnbnail,
@@ -646,6 +660,7 @@ export const Gallery = <
646660
const ImageLoadingFailedIndicator =
647661
PropImageLoadingFailedIndicator || ContextImageLoadingFailedIndicator;
648662
const ImageLoadingIndicator = PropImageLoadingIndicator || ContextImageLoadingIndicator;
663+
const ImageReloadIndicator = PropImageReloadIndicator || ContextImageReloadIndicator;
649664
const myMessageTheme = propMyMessageTheme || contextMyMessageTheme;
650665

651666
return (
@@ -658,6 +673,7 @@ export const Gallery = <
658673
hasThreadReplies: hasThreadReplies || !!message?.reply_count,
659674
ImageLoadingFailedIndicator,
660675
ImageLoadingIndicator,
676+
ImageReloadIndicator,
661677
images,
662678
legacyImageViewerSwipeBehaviour,
663679
message,

package/src/components/Attachment/ImageReloadIndicator.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ import { Refresh } from '../../icons';
66

77
const REFRESH_ICON_SIZE = 24;
88

9-
export const ImageReloadIndicator = ({
10-
onReloadImage,
11-
style,
12-
}: {
9+
export type ImageReloadIndicatorProps = {
1310
onReloadImage: () => void;
1411
style: React.ComponentProps<typeof Pressable>['style'];
15-
}) => {
12+
};
13+
14+
export const ImageReloadIndicator = ({ onReloadImage, style }: ImageReloadIndicatorProps) => {
1615
const {
1716
theme: {
1817
colors: { grey_dark },

package/src/components/Channel/Channel.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ import { Gallery as GalleryDefault } from '../Attachment/Gallery';
118118
import { Giphy as GiphyDefault } from '../Attachment/Giphy';
119119
import { ImageLoadingFailedIndicator as ImageLoadingFailedIndicatorDefault } from '../Attachment/ImageLoadingFailedIndicator';
120120
import { ImageLoadingIndicator as ImageLoadingIndicatorDefault } from '../Attachment/ImageLoadingIndicator';
121+
import { ImageReloadIndicator as ImageReloadIndicatorDefault } from '../Attachment/ImageReloadIndicator';
121122
import { VideoThumbnail as VideoThumbnailDefault } from '../Attachment/VideoThumbnail';
122123
import { AutoCompleteSuggestionHeader as AutoCompleteSuggestionHeaderDefault } from '../AutoCompleteInput/AutoCompleteSuggestionHeader';
123124
import { AutoCompleteSuggestionItem as AutoCompleteSuggestionItemDefault } from '../AutoCompleteInput/AutoCompleteSuggestionItem';
@@ -325,6 +326,7 @@ export type ChannelPropsWithContext<
325326
| 'legacyImageViewerSwipeBehaviour'
326327
| 'ImageLoadingFailedIndicator'
327328
| 'ImageLoadingIndicator'
329+
| 'ImageReloadIndicator'
328330
| 'markdownRules'
329331
| 'Message'
330332
| 'MessageActionList'
@@ -560,7 +562,7 @@ const ChannelWithContext = <
560562
handleRetry,
561563
handleThreadReply,
562564
hasCameraPicker = isImagePickerAvailable(),
563-
hasCommands = true,
565+
hasCommands,
564566
hasCreatePoll,
565567
// If pickDocument isn't available, default to hiding the file picker
566568
hasFilePicker = isDocumentPickerAvailable(),
@@ -569,6 +571,7 @@ const ChannelWithContext = <
569571
hideStickyDateHeader = false,
570572
ImageLoadingFailedIndicator = ImageLoadingFailedIndicatorDefault,
571573
ImageLoadingIndicator = ImageLoadingIndicatorDefault,
574+
ImageReloadIndicator = ImageReloadIndicatorDefault,
572575
ImageUploadPreview = ImageUploadPreviewDefault,
573576
initialScrollToFirstUnreadMessage = false,
574577
initialValue,
@@ -1828,7 +1831,7 @@ const ChannelWithContext = <
18281831
FileUploadPreview,
18291832
handleAttachButtonPress,
18301833
hasCameraPicker,
1831-
hasCommands,
1834+
hasCommands: hasCommands ?? (getChannelConfigSafely()?.commands ?? []).length > 0,
18321835
hasFilePicker,
18331836
hasImagePicker,
18341837
ImageUploadPreview,
@@ -1917,6 +1920,7 @@ const ChannelWithContext = <
19171920
hasCreatePoll === undefined ? pollCreationEnabled : hasCreatePoll && pollCreationEnabled,
19181921
ImageLoadingFailedIndicator,
19191922
ImageLoadingIndicator,
1923+
ImageReloadIndicator,
19201924
initialScrollToFirstUnreadMessage: !messageId && initialScrollToFirstUnreadMessage, // when messageId is set, we scroll to the messageId instead of first unread
19211925
InlineDateSeparator,
19221926
InlineUnreadIndicator,

package/src/components/Channel/__tests__/Channel.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ describe('Channel', () => {
7777
useMockedApis(chatClient, [getOrCreateChannelApi(mockedChannel)]);
7878
channel = chatClient.channel('messaging', mockedChannel.id);
7979
channel.cid = mockedChannel.channel.cid;
80+
const getConfigSpy = jest.fn();
81+
channel.getConfig = getConfigSpy;
8082
});
8183

8284
afterEach(() => {

package/src/components/Channel/hooks/useCreateMessagesContext.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export const useCreateMessagesContext = <
4848
hasCreatePoll,
4949
ImageLoadingFailedIndicator,
5050
ImageLoadingIndicator,
51+
ImageReloadIndicator,
5152
initialScrollToFirstUnreadMessage,
5253
InlineDateSeparator,
5354
InlineUnreadIndicator,
@@ -165,6 +166,7 @@ export const useCreateMessagesContext = <
165166
hasCreatePoll,
166167
ImageLoadingFailedIndicator,
167168
ImageLoadingIndicator,
169+
ImageReloadIndicator,
168170
initialScrollToFirstUnreadMessage,
169171
InlineDateSeparator,
170172
InlineUnreadIndicator,

package/src/components/KeyboardCompatibleView/KeyboardCompatibleView.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ export class KeyboardCompatibleView extends React.Component<
5858

5959
_relativeKeyboardHeight(keyboardFrame: KeyboardMetrics) {
6060
const frame = this._frame;
61-
if (!frame || !keyboardFrame) {
61+
/**
62+
* With iOS 14 & Reduce Motion > Prefer Cross-Fade Transitions enabled, the keyboard position
63+
* height is reported differently (0 instead of Y position value) which caused the view to take full height
64+
* of the screen.
65+
*/
66+
if (!frame || !keyboardFrame || keyboardFrame.screenY === 0) {
6267
return 0;
6368
}
6469

package/src/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export * from './Attachment/FileIcon';
88
export * from './Attachment/Gallery';
99
export * from './Attachment/Giphy';
1010
export * from './Attachment/VideoThumbnail';
11+
export * from './Attachment/ImageReloadIndicator';
1112
export * from './Attachment/utils/buildGallery/buildGallery';
1213

1314
export * from './AttachmentPicker/AttachmentPicker';

0 commit comments

Comments
 (0)