@@ -3,6 +3,7 @@ import React, { useState, useEffect } from 'react';
33import type { User } from '@sendbird/chat' ;
44import type { GroupChannel } from '@sendbird/chat/groupChannel' ;
55import type {
6+ BaseMessage ,
67 FileMessage ,
78 FileMessageCreateParams ,
89 MultipleFilesMessage ,
@@ -15,6 +16,7 @@ import {
1516 isDisabledBecauseFrozen ,
1617 isDisabledBecauseMuted ,
1718 isDisabledBecauseSuggestedReplies ,
19+ isDisabledBecauseMessageForm ,
1820} from '../../context/utils' ;
1921import useSendbirdStateContext from '../../../../hooks/useSendbirdStateContext' ;
2022import { useLocalization } from '../../../../lib/LocalizationContext' ;
@@ -34,6 +36,7 @@ export interface MessageInputWrapperViewProps {
3436 disabled ?: boolean ;
3537 // ChannelContext
3638 currentChannel : GroupChannel | null ;
39+ messages : BaseMessage [ ] ;
3740 isMultipleFilesMessageEnabled ?: boolean ;
3841 loading : boolean ;
3942 quoteMessage : SendableMessageType | null ;
@@ -58,6 +61,7 @@ export const MessageInputWrapperView = React.forwardRef((
5861 // Props
5962 const {
6063 currentChannel,
64+ messages,
6165 loading,
6266 quoteMessage,
6367 setQuoteMessage,
@@ -103,6 +107,7 @@ export const MessageInputWrapperView = React.forwardRef((
103107 || isDisabledBecauseFrozen ( currentChannel )
104108 || isDisabledBecauseMuted ( currentChannel )
105109 || isDisabledBecauseSuggestedReplies ( currentChannel , config . groupChannel . enableSuggestedReplies )
110+ || isDisabledBecauseMessageForm ( messages , config . groupChannel . enableFormTypeMessage )
106111 || disabled ;
107112
108113 const showSuggestedMentionList = ! isMessageInputDisabled
@@ -210,7 +215,14 @@ export const MessageInputWrapperView = React.forwardRef((
210215 placeholder = {
211216 ( quoteMessage && stringSet . MESSAGE_INPUT__QUOTE_REPLY__PLACE_HOLDER )
212217 || ( isDisabledBecauseFrozen ( currentChannel ) && stringSet . MESSAGE_INPUT__PLACE_HOLDER__FROZEN )
213- || ( isDisabledBecauseMuted ( currentChannel ) && ( isMobile ? stringSet . MESSAGE_INPUT__PLACE_HOLDER__MUTED_SHORT : stringSet . MESSAGE_INPUT__PLACE_HOLDER__MUTED ) )
218+ || ( isDisabledBecauseMuted ( currentChannel )
219+ && ( isMobile
220+ ? stringSet . MESSAGE_INPUT__PLACE_HOLDER__MUTED_SHORT
221+ : stringSet . MESSAGE_INPUT__PLACE_HOLDER__MUTED ) )
222+ || ( isDisabledBecauseSuggestedReplies ( currentChannel , config . groupChannel . enableSuggestedReplies )
223+ && stringSet . MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES )
224+ || ( isDisabledBecauseMessageForm ( messages , config . groupChannel . enableFormTypeMessage )
225+ && stringSet . MESSAGE_INPUT__PLACE_HOLDER__MESSAGE_FORM )
214226 || ( disabled && stringSet . MESSAGE_INPUT__PLACE_HOLDER__DISABLED )
215227 || undefined
216228 }
0 commit comments