@@ -29,12 +29,12 @@ export type InputButtonsWithContextProps<
2929 | 'hasCommands'
3030 | 'hasFilePicker'
3131 | 'hasImagePicker'
32+ | 'hasText'
3233 | 'MoreOptionsButton'
3334 | 'openCommandsPicker'
3435 | 'selectedPicker'
3536 | 'setShowMoreOptions'
3637 | 'showMoreOptions'
37- | 'text'
3838 | 'toggleAttachmentPicker'
3939> ;
4040
@@ -51,11 +51,11 @@ export const InputButtonsWithContext = <
5151 hasCommands,
5252 hasFilePicker,
5353 hasImagePicker,
54+ hasText,
5455 MoreOptionsButton,
5556 openCommandsPicker,
5657 setShowMoreOptions,
5758 showMoreOptions,
58- text,
5959 } = props ;
6060
6161 const {
@@ -81,7 +81,7 @@ export const InputButtonsWithContext = <
8181 < AttachButton />
8282 </ View >
8383 ) }
84- { hasCommands && ! text && (
84+ { hasCommands && ! hasText && (
8585 < View style = { commandsButtonContainer } >
8686 < CommandsButton handleOnPress = { openCommandsPicker } />
8787 </ View >
@@ -100,9 +100,9 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
100100 hasCommands : prevHasCommands ,
101101 hasFilePicker : prevHasFilePicker ,
102102 hasImagePicker : prevHasImagePicker ,
103+ hasText : prevHasText ,
103104 selectedPicker : prevSelectedPicker ,
104105 showMoreOptions : prevShowMoreOptions ,
105- text : prevText ,
106106 } = prevProps ;
107107
108108 const {
@@ -111,9 +111,9 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
111111 hasCommands : nextHasCommands ,
112112 hasFilePicker : nextHasFilePicker ,
113113 hasImagePicker : nextHasImagePicker ,
114+ hasText : nextHasText ,
114115 selectedPicker : nextSelectedPicker ,
115116 showMoreOptions : nextShowMoreOptions ,
116- text : nextText ,
117117 } = nextProps ;
118118
119119 if ( prevHasCameraPicker !== nextHasCameraPicker ) {
@@ -140,7 +140,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
140140 return false ;
141141 }
142142
143- if ( ( ! prevProps . text && nextText ) || ( prevText && ! nextText ) ) {
143+ if ( prevHasText !== nextHasText ) {
144144 return false ;
145145 }
146146
@@ -169,12 +169,12 @@ export const InputButtons = <
169169 hasCommands,
170170 hasFilePicker,
171171 hasImagePicker,
172+ hasText,
172173 MoreOptionsButton,
173174 openCommandsPicker,
174175 selectedPicker,
175176 setShowMoreOptions,
176177 showMoreOptions,
177- text,
178178 toggleAttachmentPicker,
179179 } = useMessageInputContext < StreamChatGenerics > ( ) ;
180180
@@ -188,12 +188,12 @@ export const InputButtons = <
188188 hasCommands,
189189 hasFilePicker,
190190 hasImagePicker,
191+ hasText,
191192 MoreOptionsButton,
192193 openCommandsPicker,
193194 selectedPicker,
194195 setShowMoreOptions,
195196 showMoreOptions,
196- text,
197197 toggleAttachmentPicker,
198198 } }
199199 { ...props }
0 commit comments