Skip to content

Commit a471add

Browse files
committed
fix: comp type declarations
1 parent 861941c commit a471add

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

package/src/components/Poll/Poll.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export type PollProps<
2929
> = Pick<PollContextValue<StreamChatGenerics>, 'poll' | 'message'> &
3030
Pick<MessagesContextValue<StreamChatGenerics>, 'PollContent'>;
3131

32+
export type PollContentProps = {
33+
PollButtons?: React.ComponentType;
34+
PollHeader?: React.ComponentType;
35+
};
36+
3237
export const PollButtons = () => (
3338
<>
3439
<ShowAllOptionsButton />
@@ -72,10 +77,7 @@ export const PollHeader = () => {
7277
export const PollContent = ({
7378
PollButtons: PollButtonsOverride,
7479
PollHeader: PollHeaderOverride,
75-
}: {
76-
PollButtons?: React.ComponentType;
77-
PollHeader?: React.ComponentType;
78-
}) => {
80+
}: PollContentProps) => {
7981
const { options } = usePollState();
8082

8183
const {

package/src/contexts/messageInputContext/MessageInputContext.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { useMessageDetailsForState } from './hooks/useMessageDetailsForState';
2929

3030
import { isUploadAllowed, MAX_FILE_SIZE_TO_UPLOAD, prettifyFileSize } from './utils/utils';
3131

32+
import { PollContentProps } from '../../components';
3233
import { AudioAttachmentProps } from '../../components/Attachment/AudioAttachment';
3334
import { parseLinksFromText } from '../../components/Message/MessageSimple/utils/parseLinks';
3435
import type { AttachButtonProps } from '../../components/MessageInput/AttachButton';
@@ -413,7 +414,7 @@ export type InputMessageInputContextValue<
413414
*/
414415
compressImageQuality?: number;
415416

416-
CreatePollContent?: React.ComponentType;
417+
CreatePollContent?: React.ComponentType<PollContentProps>;
417418

418419
/**
419420
* Override file upload request

package/src/contexts/messagesContext/MessagesContext.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { TouchableOpacityProps } from 'react-native';
44

55
import type { Attachment, ChannelState, MessageResponse } from 'stream-chat';
66

7+
import { PollContentProps } from '../../components';
78
import type { AttachmentProps } from '../../components/Attachment/Attachment';
89
import type { AttachmentActionsProps } from '../../components/Attachment/AttachmentActions';
910
import type { AudioAttachmentProps } from '../../components/Attachment/AudioAttachment';
@@ -509,7 +510,7 @@ export type MessagesContextValue<
509510
* ```
510511
*/
511512
onPressMessage?: (payload: MessageTouchableHandlerPayload<StreamChatGenerics>) => void;
512-
PollContent?: React.ComponentType;
513+
PollContent?: React.ComponentType<PollContentProps>;
513514
/**
514515
* Full override of the reaction function on Message and Message Overlay
515516
*

0 commit comments

Comments
 (0)