Add clip list component

This commit is contained in:
2022-04-30 13:59:22 +08:00
parent 5a3ec7d2af
commit 41fe51ec9c
10 changed files with 244 additions and 7 deletions
+6
View File
@@ -0,0 +1,6 @@
div.Clip-player-clip-list-root {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 10px;
}
+23 -4
View File
@@ -1,12 +1,31 @@
import { Component, ReactNode } from "react";
import { ClipList } from "@Component/ClipList/ClipList";
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
import { Theme } from "@Component/Theme/Theme";
import { Message } from "@Input/Message/Message";
import { Clip } from "@Model/Clip";
import "./ClipPlayer.scss";
class ClipPlayer extends Component {
@useStatusWithEvent("clipChange", "focusClipChange", "actuatorStartChange")
class ClipPlayer extends Component<IMixinStatusProps> {
private renderMessage(): ReactNode {
return <Message i18nKey="Panel.Info.Clip.List.Error.Nodata"/>;
}
private renderClipList(clipList: Clip[]): ReactNode {
return <ClipList
clips={clipList}
/>;
}
public render(): ReactNode {
return <>
</>;
const clipList = this.props.status?.model.clipPool ?? [];
return <Theme className="Clip-player-clip-list-root">
{ clipList.length > 0 ? null : this.renderMessage() }
{ this.renderClipList(clipList) }
</Theme>;
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ class ClipRecorder extends Component<IMixinStatusProps> {
if (mod === "R" && !runner) {
// 获取新实例
let newClip = this.props.status?.model.addClip();
let newClip = this.props.status?.newClip();
// 开启录制时钟
this.props.status?.actuator.startRecord(newClip!);