Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions examples/SampleApp/src/screens/ChannelScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import type { Channel as StreamChatChannel } from 'stream-chat';
import { RouteProp, useFocusEffect, useNavigation } from '@react-navigation/native';
import {
Expand Down Expand Up @@ -142,6 +142,14 @@ export const ChannelScreen: React.FC<ChannelScreenProps> = ({
setSelectedThread(undefined);
});

const onThreadSelect = useCallback((thread) => {
setSelectedThread(thread);
navigation.navigate('ThreadScreen', {
channel,
thread,
});
}, [channel, navigation]);

if (!channel || !chatClient) {
return null;
}
Expand All @@ -161,13 +169,7 @@ export const ChannelScreen: React.FC<ChannelScreenProps> = ({
>
<ChannelHeader channel={channel} />
<MessageList<StreamChatGenerics>
onThreadSelect={(thread) => {
setSelectedThread(thread);
navigation.navigate('ThreadScreen', {
channel,
thread,
});
}}
onThreadSelect={onThreadSelect}
/>
<AITypingIndicatorView channel={channel} />
<MessageInput />
Expand Down
8 changes: 4 additions & 4 deletions package/expo-package/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4733,10 +4733,10 @@ [email protected], stream-buffers@~2.2.0:
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==

[email protected].1:
version "6.7.1"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.7.1.tgz#37cdfbc5c7f8a5bac5634b954da4bbdcd2fb95f2"
integrity sha512-4ePEMt1W+iw3zUulSDRFO9Nt4HPa8kW6wJ3Qv+ZN+y886rvcUuTuH18MFrdrJtHYb+UxCU+X3oz++3qzq7Jzxw==
[email protected].2:
version "6.7.2"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.7.2.tgz#955e048b80c55175db084ccbb8519f52ef4bb00c"
integrity sha512-WJFOCfQ7Xpn8Lr4AE6hUh4Qhrn1eGzsoAcKmL8eSoB/etxdNllOyZ3zrwvZgyy+KIEg9bcX4y+3OWtdKW6qfsA==
dependencies:
"@gorhom/bottom-sheet" "^5.1.1"
dayjs "1.10.5"
Expand Down
8 changes: 4 additions & 4 deletions package/native-package/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3409,10 +3409,10 @@ statuses@~1.5.0:
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==

[email protected].1:
version "6.7.1"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.7.1.tgz#37cdfbc5c7f8a5bac5634b954da4bbdcd2fb95f2"
integrity sha512-4ePEMt1W+iw3zUulSDRFO9Nt4HPa8kW6wJ3Qv+ZN+y886rvcUuTuH18MFrdrJtHYb+UxCU+X3oz++3qzq7Jzxw==
[email protected].2:
version "6.7.2"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.7.2.tgz#955e048b80c55175db084ccbb8519f52ef4bb00c"
integrity sha512-WJFOCfQ7Xpn8Lr4AE6hUh4Qhrn1eGzsoAcKmL8eSoB/etxdNllOyZ3zrwvZgyy+KIEg9bcX4y+3OWtdKW6qfsA==
dependencies:
"@gorhom/bottom-sheet" "^5.1.1"
dayjs "1.10.5"
Expand Down
38 changes: 17 additions & 21 deletions package/src/components/AutoCompleteInput/AutoCompleteInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { I18nManager, StyleSheet, TextInput, TextInputProps } from 'react-native

import throttle from 'lodash/throttle';

import {
ChannelContextValue,
useChannelContext,
} from '../../contexts/channelContext/ChannelContext';
import {
MessageInputContextValue,
useMessageInputContext,
Expand Down Expand Up @@ -53,22 +49,22 @@ const isCommand = (text: string) => text[0] === '/' && text.split(' ').length <=

type AutoCompleteInputPropsWithContext<
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
> = Pick<ChannelContextValue<StreamChatGenerics>, 'giphyEnabled'> &
Pick<
MessageInputContextValue<StreamChatGenerics>,
| 'additionalTextInputProps'
| 'autoCompleteSuggestionsLimit'
| 'giphyActive'
| 'maxMessageLength'
| 'mentionAllAppUsersEnabled'
| 'mentionAllAppUsersQuery'
| 'numberOfLines'
| 'onChange'
| 'setGiphyActive'
| 'setInputBoxRef'
| 'text'
| 'triggerSettings'
> &
> = Pick<
MessageInputContextValue<StreamChatGenerics>,
| 'additionalTextInputProps'
| 'autoCompleteSuggestionsLimit'
| 'giphyActive'
| 'giphyEnabled'
| 'maxMessageLength'
| 'mentionAllAppUsersEnabled'
| 'mentionAllAppUsersQuery'
| 'numberOfLines'
| 'onChange'
| 'setGiphyActive'
| 'setInputBoxRef'
| 'text'
| 'triggerSettings'
> &
Pick<
SuggestionsContextValue<StreamChatGenerics>,
'closeSuggestions' | 'openSuggestions' | 'updateSuggestions'
Expand Down Expand Up @@ -484,8 +480,8 @@ export const AutoCompleteInput = <
>(
props: AutoCompleteInputProps<StreamChatGenerics>,
) => {
const { giphyEnabled } = useChannelContext<StreamChatGenerics>();
const {
giphyEnabled,
additionalTextInputProps,
autoCompleteSuggestionsLimit,
giphyActive,
Expand Down
Loading
Loading