Skip to content

Commit 53e4f1f

Browse files
committed
refactor: remove disableMentions, doFileUploadRequest, doImageUploadRequest from MessageInputProps
1 parent 4681a39 commit 53e4f1f

File tree

3 files changed

+2
-28
lines changed

3 files changed

+2
-28
lines changed

src/components/MessageInput/AttachmentSelector.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { nanoid } from 'nanoid';
22
import type { ElementRef } from 'react';
33
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
44
import { UploadIcon as DefaultUploadIcon } from './icons';
5+
import { useAttachmentManagerState } from './hooks/useAttachmentManagerState';
56
import { CHANNEL_CONTAINER_ID } from '../Channel/constants';
67
import { DialogAnchor, useDialog, useDialogIsOpen } from '../Dialog';
78
import { DialogMenuButton } from '../Dialog/DialogMenu';
@@ -20,8 +21,6 @@ import {
2021
useAttachmentSelectorContext,
2122
} from '../../context/AttachmentSelectorContext';
2223

23-
import { useAttachmentManagerState } from './hooks/useAttachmentManagerState';
24-
2524
export const SimpleAttachmentSelector = () => {
2625
const {
2726
AttachmentSelectorInitiationButtonContents,

src/components/MessageInput/MessageInput.tsx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,7 @@ import { useComponentContext } from '../../context/ComponentContext';
1111
import { MessageInputContextProvider } from '../../context/MessageInputContext';
1212
import { DialogManagerProvider } from '../../context';
1313

14-
import type {
15-
Channel,
16-
LocalAttachmentUploadMetadata,
17-
LocalMessage,
18-
Message,
19-
SendFileAPIResponse,
20-
SendMessageOptions,
21-
} from 'stream-chat';
14+
import type { LocalMessage, Message, SendMessageOptions } from 'stream-chat';
2215

2316
import type { SearchQueryParams } from '../ChannelSearch/hooks/useChannelSearch';
2417
import type { CustomAudioRecordingConfig } from '../MediaRecorder';
@@ -61,18 +54,6 @@ export type MessageInputProps = {
6154
clearEditingState?: () => void;
6255
/** If true, disables the text input */
6356
disabled?: boolean;
64-
/** If true, the suggestion list will not display and autocomplete @mentions. Default: false. */
65-
disableMentions?: boolean;
66-
/** Function to override the default file upload request */
67-
doFileUploadRequest?: (
68-
file: LocalAttachmentUploadMetadata['file'],
69-
channel: Channel,
70-
) => Promise<SendFileAPIResponse>;
71-
/** Function to override the default image upload request */
72-
doImageUploadRequest?: (
73-
file: LocalAttachmentUploadMetadata['file'],
74-
channel: Channel,
75-
) => Promise<SendFileAPIResponse>;
7657
/** Mechanism to be used with autocomplete and text replace features of the `MessageInput` component, see [emoji-mart `SearchIndex`](https://github.com/missive/emoji-mart#%EF%B8%8F%EF%B8%8F-headless-search) */
7758
emojiSearchIndex?: ComponentContextValue['emojiSearchIndex'];
7859
/** If true, focuses the text input on component mount */

src/components/MessageInput/hooks/useCreateMessageInputContext.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ export const useCreateMessageInputContext = (value: MessageInputContextValue) =>
1111
cooldownInterval,
1212
cooldownRemaining,
1313
disabled,
14-
disableMentions,
15-
doFileUploadRequest,
16-
doImageUploadRequest,
1714
emojiSearchIndex,
1815
focus,
1916
grow,
@@ -44,9 +41,6 @@ export const useCreateMessageInputContext = (value: MessageInputContextValue) =>
4441
cooldownInterval,
4542
cooldownRemaining,
4643
disabled,
47-
disableMentions,
48-
doFileUploadRequest,
49-
doImageUploadRequest,
5044
emojiSearchIndex,
5145
focus,
5246
grow,

0 commit comments

Comments
 (0)