Skip to content

Commit d4237bb

Browse files
committed
Merge branch 'develop' into V7
# Conflicts: # package/expo-package/package.json # package/native-package/package.json # package/src/components/AutoCompleteInput/AutoCompleteInput.tsx # package/src/components/MessageInput/MessageInput.tsx # package/src/components/MessageInput/MoreOptionsButton.tsx # package/src/contexts/messageInputContext/MessageInputContext.tsx # package/src/contexts/suggestionsContext/SuggestionsContext.tsx
2 parents 40dee7e + e787038 commit d4237bb

File tree

18 files changed

+580
-993
lines changed

18 files changed

+580
-993
lines changed

package/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log
22

3+
### [6.7.2](https://github.com/GetStream/stream-chat-react-native/compare/v6.7.1...v6.7.2) (2025-04-09)
4+
5+
6+
### Bug Fixes
7+
8+
* add property to customize the wrapper style of message ([#3052](https://github.com/GetStream/stream-chat-react-native/issues/3052)) ([74a3d04](https://github.com/GetStream/stream-chat-react-native/commit/74a3d04c73e6790bf2d8ac7beffa43cccb2bbfca))
9+
* bottom sheet animations on new reactions ([#3044](https://github.com/GetStream/stream-chat-react-native/issues/3044)) ([3e49044](https://github.com/GetStream/stream-chat-react-native/commit/3e49044a86fa747a63c11ecb8afc9c136f86c5ed))
10+
311
### [6.7.1](https://github.com/GetStream/stream-chat-react-native/compare/v6.7.0...v6.7.1) (2025-03-27)
412

513

package/expo-package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stream-chat-expo",
33
"description": "The official Expo SDK for Stream Chat, a service for building chat applications",
4-
"version": "6.6.8",
4+
"version": "6.7.2",
55
"author": {
66
"company": "Stream.io Inc",
77
"name": "Stream.io Inc"

package/native-package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stream-chat-react-native",
33
"description": "The official React Native SDK for Stream Chat, a service for building chat applications",
4-
"version": "6.6.8",
4+
"version": "6.7.2",
55
"homepage": "https://www.npmjs.com/package/stream-chat-react-native",
66
"author": {
77
"company": "Stream.io Inc",

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stream-chat-react-native-core",
33
"description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
4-
"version": "6.7.1",
4+
"version": "6.7.2",
55
"author": {
66
"company": "Stream.io Inc",
77
"name": "Stream.io Inc"

package/src/components/AutoCompleteInput/AutoCompleteInput.tsx

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import { I18nManager, StyleSheet, TextInput, TextInputProps } from 'react-native
33

44
import throttle from 'lodash/throttle';
55

6-
import {
7-
ChannelContextValue,
8-
useChannelContext,
9-
} from '../../contexts/channelContext/ChannelContext';
106
import {
117
MessageInputContextValue,
128
useMessageInputContext,
@@ -51,23 +47,26 @@ const computeCaretPosition = (token: string, startOfTokenPosition: number) =>
5147

5248
const isCommand = (text: string) => text[0] === '/' && text.split(' ').length <= 1;
5349

54-
type AutoCompleteInputPropsWithContext = Pick<ChannelContextValue, 'giphyEnabled'> &
50+
type AutoCompleteInputPropsWithContext = Pick<
51+
MessageInputContextValue,
52+
| 'additionalTextInputProps'
53+
| 'autoCompleteSuggestionsLimit'
54+
| 'giphyActive'
55+
| 'giphyEnabled'
56+
| 'maxMessageLength'
57+
| 'mentionAllAppUsersEnabled'
58+
| 'mentionAllAppUsersQuery'
59+
| 'numberOfLines'
60+
| 'onChange'
61+
| 'setGiphyActive'
62+
| 'setInputBoxRef'
63+
| 'text'
64+
| 'triggerSettings'
65+
> &
5566
Pick<
56-
MessageInputContextValue,
57-
| 'additionalTextInputProps'
58-
| 'autoCompleteSuggestionsLimit'
59-
| 'giphyActive'
60-
| 'maxMessageLength'
61-
| 'mentionAllAppUsersEnabled'
62-
| 'mentionAllAppUsersQuery'
63-
| 'numberOfLines'
64-
| 'onChange'
65-
| 'setGiphyActive'
66-
| 'setInputBoxRef'
67-
| 'text'
68-
| 'triggerSettings'
67+
SuggestionsContextValue,
68+
'closeSuggestions' | 'openSuggestions' | 'updateSuggestions'
6969
> &
70-
Pick<SuggestionsContextValue, 'closeSuggestions' | 'openSuggestions' | 'updateSuggestions'> &
7170
Pick<TranslationContextValue, 't'> & {
7271
/**
7372
* This is currently passed in from MessageInput to avoid rerenders
@@ -462,9 +461,11 @@ const MemoizedAutoCompleteInput = React.memo(
462461
areEqual,
463462
) as typeof AutoCompleteInputWithContext;
464463

465-
export const AutoCompleteInput = (props: AutoCompleteInputProps) => {
466-
const { giphyEnabled } = useChannelContext();
464+
export const AutoCompleteInput = (
465+
props: AutoCompleteInputProps,
466+
) => {
467467
const {
468+
giphyEnabled,
468469
additionalTextInputProps,
469470
autoCompleteSuggestionsLimit,
470471
giphyActive,

package/src/components/Channel/Channel.tsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -771,9 +771,11 @@ const ChannelWithContext = (props: PropsWithChildren<ChannelPropsWithContext>) =
771771
}
772772

773773
// If the event is typing.start or typing.stop, set the typing state
774-
const isTypingEvent = event.type === 'typing.start' || event.type === 'typing.stop';
775-
if (isTypingEvent) {
776-
setTyping(channel);
774+
if (event.type === 'typing.start' || event.type === 'typing.stop') {
775+
if (event.user?.id !== client.userID) {
776+
setTyping(channel);
777+
}
778+
return;
777779
} else {
778780
if (thread?.id) {
779781
const updatedThreadMessages =
@@ -1719,6 +1721,11 @@ const ChannelWithContext = (props: PropsWithChildren<ChannelPropsWithContext>) =
17191721
// once our memoization issues are fixed in most places in the app or we move to a reactive state store.
17201722
const sendMessageRef = useRef<InputMessageInputContextValue['sendMessage']>(sendMessage);
17211723
sendMessageRef.current = sendMessage;
1724+
const sendMessageStable = useCallback<
1725+
InputMessageInputContextValue<StreamChatGenerics>['sendMessage']
1726+
>((...args) => {
1727+
return sendMessageRef.current(...args);
1728+
}, []);
17221729

17231730
const inputMessageInputContext = useCreateInputMessageInputContext({
17241731
additionalTextInputProps,
@@ -1772,7 +1779,7 @@ const ChannelWithContext = (props: PropsWithChildren<ChannelPropsWithContext>) =
17721779
quotedMessage,
17731780
SendButton,
17741781
sendImageAsync,
1775-
sendMessage: (...args) => sendMessageRef.current(...args),
1782+
sendMessage: sendMessageStable,
17761783
SendMessageDisallowedIndicator,
17771784
setInputRef,
17781785
setQuotedMessageState,
@@ -1905,11 +1912,13 @@ const ChannelWithContext = (props: PropsWithChildren<ChannelPropsWithContext>) =
19051912
VideoThumbnail,
19061913
});
19071914

1908-
const suggestionsContext = {
1909-
AutoCompleteSuggestionHeader,
1910-
AutoCompleteSuggestionItem,
1911-
AutoCompleteSuggestionList,
1912-
};
1915+
const suggestionsContext = useMemo(() => {
1916+
return {
1917+
AutoCompleteSuggestionHeader,
1918+
AutoCompleteSuggestionItem,
1919+
AutoCompleteSuggestionList,
1920+
};
1921+
}, [AutoCompleteSuggestionHeader, AutoCompleteSuggestionItem, AutoCompleteSuggestionList]);
19131922

19141923
const threadContext = useCreateThreadContext({
19151924
allowThreadMessagesInChannel,

package/src/components/Message/Message.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
277277
const {
278278
theme: {
279279
colors: { targetedMessageBackground },
280-
messageSimple: { targetedMessageContainer, unreadUnderlayColor },
280+
messageSimple: { targetedMessageContainer, unreadUnderlayColor, wrapper },
281281
screenPadding,
282282
},
283283
} = useTheme();
@@ -718,8 +718,12 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
718718
<View
719719
style={[
720720
{ marginTop: 2, paddingHorizontal: screenPadding },
721+
wrapper,
721722
(isTargetedMessage || message.pinned) && !isMessageTypeDeleted
722-
? { backgroundColor: targetedMessageBackground, ...targetedMessageContainer }
723+
? {
724+
backgroundColor: targetedMessageBackground,
725+
...targetedMessageContainer,
726+
}
723727
: {},
724728
]}
725729
testID='message-wrapper'

0 commit comments

Comments
 (0)