Skip to content

Commit

Permalink
fix: add StreamedMessageText to component ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
isekovanic committed Dec 3, 2024
1 parent bb98f69 commit 583df0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/components/Channel/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ type ChannelPropsForwardedToComponentContext<
| 'UnreadMessagesSeparator'
| 'VirtualMessage'
| 'StopAIGenerationButton'
| 'StreamedMessageText'
>;

const isUserResponseArray = <
Expand Down Expand Up @@ -1275,6 +1276,7 @@ const ChannelInner = <
SendButton: props.SendButton,
StartRecordingAudioButton: props.StartRecordingAudioButton,
StopAIGenerationButton: props.StopAIGenerationButton,
StreamedMessageText: props.StreamedMessageText,
ThreadHead: props.ThreadHead,
ThreadHeader: props.ThreadHeader,
ThreadStart: props.ThreadStart,
Expand Down Expand Up @@ -1342,6 +1344,7 @@ const ChannelInner = <
props.UnreadMessagesSeparator,
props.VirtualMessage,
props.StopAIGenerationButton,
props.StreamedMessageText,
props.emojiSearchIndex,
props.reactionOptions,
],
Expand Down
3 changes: 2 additions & 1 deletion src/components/Message/MessageSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { MessageEditedTimestamp } from './MessageEditedTimestamp';

import type { MessageUIComponentProps } from './types';
import type { DefaultStreamChatGenerics } from '../../types/types';
import { StreamedMessageText } from './StreamedMessageText';
import { StreamedMessageText as DefaultStreamedMessageText } from './StreamedMessageText';

type MessageSimpleWithContextProps<
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
Expand Down Expand Up @@ -82,6 +82,7 @@ const MessageSimpleWithContext = <
MessageStatus = DefaultMessageStatus,
MessageTimestamp = DefaultMessageTimestamp,
ReactionsList = DefaultReactionList,
StreamedMessageText = DefaultStreamedMessageText,
PinIndicator,
} = useComponentContext<StreamChatGenerics>('MessageSimple');

Expand Down
2 changes: 2 additions & 0 deletions src/context/ComponentContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
RecordingPermissionDeniedNotificationProps,
SendButtonProps,
StartRecordingAudioButtonProps,
StreamedMessageTextProps,
SuggestionItemProps,
SuggestionListProps,
ThreadHeaderProps,
Expand Down Expand Up @@ -166,6 +167,7 @@ export type ComponentContextValue<
/** Custom UI component button for initiating audio recording, defaults to and accepts same props as: [StartRecordingAudioButton](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MediaRecorder/AudioRecorder/AudioRecordingButtons.tsx) */
StartRecordingAudioButton?: React.ComponentType<StartRecordingAudioButtonProps>;
StopAIGenerationButton?: React.ComponentType<StopAIGenerationButtonProps> | null;
StreamedMessageText?: React.ComponentType<StreamedMessageTextProps>;
/** Custom UI component that displays thread's parent or other message at the top of the `MessageList`, defaults to and accepts same props as [MessageSimple](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageSimple.tsx) */
ThreadHead?: React.ComponentType<MessageProps<StreamChatGenerics>>;
/** Custom UI component to display the header of a `Thread`, defaults to and accepts same props as: [DefaultThreadHeader](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Thread/Thread.tsx) */
Expand Down

0 comments on commit 583df0c

Please sign in to comment.