diff --git a/src/components/views/rooms/MessageComposer.tsx b/src/components/views/rooms/MessageComposer.tsx index 8455e9aa11..c39d8bebc8 100644 --- a/src/components/views/rooms/MessageComposer.tsx +++ b/src/components/views/rooms/MessageComposer.tsx @@ -368,6 +368,8 @@ export default class MessageComposer extends React.Component { null, ]; + const buttons = []; + if (!this.state.tombstone && this.state.canSendMessages) { controls.push( { ); if (!this.state.haveRecording) { - controls.push( + buttons.push( , , ); @@ -392,7 +394,7 @@ export default class MessageComposer extends React.Component { if (SettingsStore.getValue(UIFeature.Widgets) && SettingsStore.getValue("MessageComposerInput.showStickersButton") && !this.state.haveRecording) { - controls.push(); + buttons.push(); } controls.push( { ref={c => this.voiceRecordingButton = c} room={this.props.room} />); + if (!this.state.haveRecording) { + buttons.push( + this.voiceRecordingButton?.onRecordStartEndClick()} + title={_t("Send voice message")} + />, + ); + } + if (!this.state.isComposerEmpty || this.state.haveRecording) { - controls.push( + buttons.push( {
{ controls } + { buttons }
diff --git a/src/components/views/rooms/VoiceRecordComposerTile.tsx b/src/components/views/rooms/VoiceRecordComposerTile.tsx index e8befb90fa..c6f831de3b 100644 --- a/src/components/views/rooms/VoiceRecordComposerTile.tsx +++ b/src/components/views/rooms/VoiceRecordComposerTile.tsx @@ -137,7 +137,7 @@ export default class VoiceRecordComposerTile extends React.PureComponent { + public onRecordStartEndClick = async () => { if (this.state.recorder) { await this.state.recorder.stop(); return; @@ -215,6 +215,8 @@ export default class VoiceRecordComposerTile extends React.PureComponent