Consolidate TileShape into TimelineRenderingType (#7843)
This commit is contained in:
parent
ca89d3b96e
commit
5f5bb4a4fe
21 changed files with 174 additions and 154 deletions
|
@ -18,7 +18,6 @@ import React, { ReactNode } from "react";
|
|||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import { Playback, PlaybackState } from "../../../audio/Playback";
|
||||
import { TileShape } from "../rooms/EventTile";
|
||||
import { UPDATE_EVENT } from "../../../stores/AsyncStore";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
import { _t } from "../../../languageHandler";
|
||||
|
@ -29,7 +28,6 @@ interface IProps {
|
|||
playback: Playback;
|
||||
|
||||
mediaName?: string;
|
||||
tileShape?: TileShape;
|
||||
}
|
||||
|
||||
interface IState {
|
||||
|
|
|
@ -19,16 +19,19 @@ import React, { ReactNode } from "react";
|
|||
import PlayPauseButton from "./PlayPauseButton";
|
||||
import PlaybackClock from "./PlaybackClock";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
import { TileShape } from "../rooms/EventTile";
|
||||
import PlaybackWaveform from "./PlaybackWaveform";
|
||||
import AudioPlayerBase from "./AudioPlayerBase";
|
||||
import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext";
|
||||
|
||||
@replaceableComponent("views.audio_messages.RecordingPlayback")
|
||||
export default class RecordingPlayback extends AudioPlayerBase {
|
||||
static contextType = RoomContext;
|
||||
public context!: React.ContextType<typeof RoomContext>;
|
||||
|
||||
private get isWaveformable(): boolean {
|
||||
return this.props.tileShape !== TileShape.Notif
|
||||
&& this.props.tileShape !== TileShape.FileGrid
|
||||
&& this.props.tileShape !== TileShape.Pinned;
|
||||
return this.context.timelineRenderingType !== TimelineRenderingType.Notification
|
||||
&& this.context.timelineRenderingType !== TimelineRenderingType.File
|
||||
&& this.context.timelineRenderingType !== TimelineRenderingType.Pinned;
|
||||
}
|
||||
|
||||
protected renderComponent(): ReactNode {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue