Skip to content

Commit 8d3d432

Browse files
Added support for extra props (to open/close attachment/commands picker) on Input component
1 parent a4fa893 commit 8d3d432

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/components/MessageInput/MessageInput.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,11 @@ export const MessageInputWithContext = <
481481
{Input ? (
482482
<Input
483483
additionalTextInputProps={additionalTextInputContainerProps}
484+
closeAttachmentPicker={closeAttachmentPicker}
484485
getUsers={getUsers}
485-
handleOnPress={toggleAttachmentPicker}
486+
openAttachmentPicker={openAttachmentPicker}
487+
openCommandsPicker={openCommandsPicker}
488+
toggleAttachmentPicker={toggleAttachmentPicker}
486489
/>
487490
) : (
488491
<>

src/contexts/messageInputContext/MessageInputContext.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,10 @@ export type InputMessageInputContextValue<
354354
* Has access to all of [MessageInputContext](https://github.com/GetStream/stream-chat-react-native/blob/master/src/contexts/messageInputContext/MessageInputContext.tsx)
355355
*/
356356
Input?: React.ComponentType<
357-
Omit<MessageInputProps<At, Ch, Co, Ev, Me, Re, Us>, 'Input'> & {
358-
getUsers: () => UserResponse<Us>[];
359-
handleOnPress: () => void | Promise<void>;
360-
}
357+
Omit<MessageInputProps<At, Ch, Co, Ev, Me, Re, Us>, 'Input'> &
358+
InputButtonsProps<At, Ch, Co, Ev, Me, Re, Us> & {
359+
getUsers: () => UserResponse<Us>[];
360+
}
361361
>;
362362
InputButtons?: React.ComponentType<
363363
InputButtonsProps<At, Ch, Co, Ev, Me, Re, Us>

0 commit comments

Comments
 (0)