Actually use a waveform instead of the frequency data

This commit is contained in:
Travis Ralston 2021-03-24 23:31:02 -06:00
parent 8ddd14e252
commit 449e028bbd
7 changed files with 159 additions and 80 deletions

View file

@ -21,7 +21,7 @@ import {VoiceRecorder} from "../../../voice/VoiceRecorder";
import {Room} from "matrix-js-sdk/src/models/room";
import {MatrixClientPeg} from "../../../MatrixClientPeg";
import classNames from "classnames";
import FrequencyBars from "../voice_messages/FrequencyBars";
import LiveRecordingWaveform from "../voice_messages/LiveRecordingWaveform";
interface IProps {
room: Room;
@ -68,16 +68,16 @@ export default class VoiceRecordComposerTile extends React.PureComponent<IProps,
'mx_VoiceRecordComposerTile_stop': !!this.state.recorder,
});
let bars = null;
let waveform = null;
let tooltip = _t("Record a voice message");
if (!!this.state.recorder) {
// TODO: @@ TravisR: Change to match behaviour
tooltip = _t("Stop & send recording");
bars = <FrequencyBars recorder={this.state.recorder} />;
waveform = <LiveRecordingWaveform recorder={this.state.recorder} />;
}
return (<>
{bars}
{waveform}
<AccessibleTooltipButton
className={classes}
onClick={this.onStartStopVoiceMessage}