Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Create narrow mode for Composer #6682

Merged
merged 16 commits into from
Sep 7, 2021
11 changes: 4 additions & 7 deletions src/components/views/rooms/VoiceRecordComposerTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export default class VoiceRecordComposerTile extends React.PureComponent<IProps,
public render(): ReactNode {
if (!this.state.recordingPhase) return null;
germain-gg marked this conversation as resolved.
Show resolved Hide resolved

let stopOrRecordBtn;
let stopBtn;
let deleteButton;
if (!this.state.recordingPhase || this.state.recordingPhase === RecordingState.Started) {
germain-gg marked this conversation as resolved.
Show resolved Hide resolved
const classes = classNames({
Expand All @@ -231,13 +231,13 @@ export default class VoiceRecordComposerTile extends React.PureComponent<IProps,
tooltip = _t("Stop recording");
}

stopOrRecordBtn = <AccessibleTooltipButton
stopBtn = <AccessibleTooltipButton
className={classes}
onClick={this.onRecordStartEndClick}
title={tooltip}
/>;
if (this.state.recorder && !this.state.recorder?.isRecording) {
stopOrRecordBtn = null;
stopBtn = null;
}
}

Expand Down Expand Up @@ -266,13 +266,10 @@ export default class VoiceRecordComposerTile extends React.PureComponent<IProps,
</span>;
}

// The record button (mic icon) is meant to be on the right edge, but we also want the
// stop button to be left of the waveform area. Luckily, none of the surrounding UI is
// rendered when we're not recording, so the record button ends up in the correct spot.
return (<>
{ uploadIndicator }
{ deleteButton }
{ stopOrRecordBtn }
{ stopBtn }
{ this.renderWaveformArea() }
</>);
}
Expand Down