Skip to content

Commit

Permalink
feat: inputDisabled prop opened as public
Browse files Browse the repository at this point in the history
  • Loading branch information
bang9 committed Apr 8, 2024
1 parent 5cc9300 commit 6eb4ad0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ChannelInput from '../../../components/ChannelInput';
import { GroupChannelContexts } from '../module/moduleContext';
import type { GroupChannelProps } from '../types';

const GroupChannelInput = (props: GroupChannelProps['Input']) => {
const GroupChannelInput = ({ inputDisabled, ...props }: GroupChannelProps['Input']) => {
const {
channel,
keyboardAvoidOffset = 0,
Expand All @@ -25,10 +25,10 @@ const GroupChannelInput = (props: GroupChannelProps['Input']) => {
setMessageToEdit={setMessageToEdit}
messageToReply={messageToReply}
setMessageToReply={setMessageToReply}
keyboardAvoidOffset={keyboardAvoidOffset}
inputMuted={chatAvailableState.muted}
inputFrozen={chatAvailableState.frozen}
inputDisabled={chatAvailableState.disabled}
keyboardAvoidOffset={keyboardAvoidOffset}
inputDisabled={inputDisabled ?? chatAvailableState.disabled}
{...props}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface GroupChannelProps {
};
Input: Pick<
ChannelInputProps,
| 'inputDisabled'
| 'shouldRenderInput'
| 'onPressSendUserMessage'
| 'onPressSendFileMessage'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useSendbirdChat } from '../../../hooks/useContext';
import { OpenChannelContexts } from '../module/moduleContext';
import type { OpenChannelProps } from '../types';

const OpenChannelInput = (props: OpenChannelProps['Input']) => {
const OpenChannelInput = ({ inputDisabled, ...props }: OpenChannelProps['Input']) => {
const { sdk, currentUser } = useSendbirdChat();

const {
Expand Down Expand Up @@ -64,10 +64,10 @@ const OpenChannelInput = (props: OpenChannelProps['Input']) => {
channel={channel}
messageToEdit={messageToEdit}
setMessageToEdit={setMessageToEdit}
keyboardAvoidOffset={keyboardAvoidOffset}
inputMuted={chatAvailableState.muted}
inputFrozen={channel.isFrozen}
inputDisabled={chatAvailableState.disabled}
keyboardAvoidOffset={keyboardAvoidOffset}
inputDisabled={inputDisabled ?? chatAvailableState.disabled}
{...props}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export type OpenChannelProps = {
>;
Input: Pick<
ChannelInputProps,
| 'inputDisabled'
| 'shouldRenderInput'
| 'onPressSendUserMessage'
| 'onPressSendFileMessage'
Expand Down

0 comments on commit 6eb4ad0

Please sign in to comment.