Skip to content

Commit 8f480d7

Browse files
committed
fix: how threadList prop is passed
1 parent 3dcc0ce commit 8f480d7

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

package/src/components/MessageInput/MessageInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => {
222222
isOnline,
223223
members,
224224
Reply,
225+
threadList,
225226
SendButton,
226227
sendMessage,
227228
showPollCreationDialog,
@@ -588,7 +589,7 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => {
588589
</>
589590
)}
590591
</View>
591-
<ShowThreadMessageInChannelButton />
592+
<ShowThreadMessageInChannelButton threadList={threadList} />
592593
</View>
593594

594595
<View style={[styles.suggestionsListContainer, { bottom: height }, suggestionListContainer]}>

package/src/components/MessageInput/ShowThreadMessageInChannelButton.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ import { Pressable, StyleSheet, Text, View } from 'react-native';
33

44
import { MessageComposerState } from 'stream-chat';
55

6-
import {
7-
ChannelContextValue,
8-
useChannelContext,
9-
} from '../../contexts/channelContext/ChannelContext';
6+
import { ChannelContextValue } from '../../contexts/channelContext/ChannelContext';
107
import { useMessageComposer } from '../../contexts/messageInputContext/hooks/useMessageComposer';
118
import { useTheme } from '../../contexts/themeContext/ThemeContext';
129
import { ThreadContextValue, useThreadContext } from '../../contexts/threadContext/ThreadContext';
@@ -25,8 +22,7 @@ export type ShowThreadMessageInChannelButtonWithContextProps = Pick<
2522
ThreadContextValue,
2623
'allowThreadMessagesInChannel'
2724
> &
28-
Pick<TranslationContextValue, 't'> &
29-
Pick<ChannelContextValue, 'threadList'>;
25+
Pick<TranslationContextValue, 't'> & { threadList?: ChannelContextValue['threadList'] };
3026

3127
export const ShowThreadMessageInChannelButtonWithContext = (
3228
props: ShowThreadMessageInChannelButtonWithContextProps,
@@ -129,7 +125,6 @@ export type ShowThreadMessageInChannelButtonProps =
129125
Partial<ShowThreadMessageInChannelButtonWithContextProps>;
130126

131127
export const ShowThreadMessageInChannelButton = (props: ShowThreadMessageInChannelButtonProps) => {
132-
const { threadList } = useChannelContext();
133128
const { t } = useTranslationContext();
134129
const { allowThreadMessagesInChannel } = useThreadContext();
135130

@@ -138,7 +133,6 @@ export const ShowThreadMessageInChannelButton = (props: ShowThreadMessageInChann
138133
{...{
139134
allowThreadMessagesInChannel,
140135
t,
141-
threadList,
142136
}}
143137
{...props}
144138
/>

0 commit comments

Comments
 (0)