Skip to content

Commit e15fe90

Browse files
authored
fix(flat-pages): register apps in replay page (#1893)
1 parent d7422e7 commit e15fe90

File tree

2 files changed

+43
-40
lines changed

2 files changed

+43
-40
lines changed

packages/flat-components/src/components/SettingPage/AppearancePicker/ThemePicker.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ export const Overview: Story<AppearancePickerProps> = args => (
1818
</Router>
1919
);
2020
Overview.args = {
21-
defaultValue: "light",
21+
value: "light",
2222
};

packages/flat-pages/src/ReplayPage/index.tsx

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,57 +15,60 @@ import { useLoginCheck } from "../utils/use-login-check";
1515
import { ReplayList } from "./ReplayList";
1616
import { ReplayVideo } from "./ReplayVideo";
1717
import { ReplayWhiteboard } from "./ReplayWhiteboard";
18+
import { withFlatServices } from "../components/FlatServicesContext";
1819

1920
export type ReplayPageProps = RouteComponentProps<{
2021
roomUUID: string;
2122
ownerUUID: string;
2223
roomType: RoomType;
2324
}>;
2425

25-
export const ReplayPage = observer<ReplayPageProps>(function ReplayPage({ match }) {
26-
useLoginCheck();
26+
export const ReplayPage = withFlatServices("whiteboard")(
27+
observer<ReplayPageProps>(function ReplayPage({ match }) {
28+
useLoginCheck();
2729

28-
const history = useHistory();
29-
const classroomReplayStore = useClassroomReplayStore(match.params);
30-
const [showExitReplayModal, setShowExitReplayModal] = useState(false);
30+
const history = useHistory();
31+
const classroomReplayStore = useClassroomReplayStore(match.params);
32+
const [showExitReplayModal, setShowExitReplayModal] = useState(false);
3133

32-
const windowsBtn = useContext(WindowsSystemBtnContext);
34+
const windowsBtn = useContext(WindowsSystemBtnContext);
3335

34-
if (!classroomReplayStore) {
35-
return <LoadingPage />;
36-
}
36+
if (!classroomReplayStore) {
37+
return <LoadingPage />;
38+
}
3739

38-
return (
39-
<div className="replay-container">
40-
{windowsBtn && (
41-
<TopBar
42-
showWindowsSystemBtn={windowsBtn.showWindowsBtn}
43-
onClickWindowsSystemBtn={windowsBtn.onClickWindowsSystemBtn}
44-
onDoubleClick={windowsBtn.clickWindowMaximize}
45-
/>
46-
)}
47-
<div className="replay-videos is-horizontal">
48-
<ReplayVideo classroomReplayStore={classroomReplayStore} />
49-
</div>
50-
<div className="replay-content">
51-
<ReplayWhiteboard classroomReplayStore={classroomReplayStore} />
52-
<div className="replay-share-screen">{/* TODO */}</div>
53-
<div
54-
className={classNames("replay-bottom", {
55-
"is-playing": classroomReplayStore.isPlaying,
56-
})}
57-
>
58-
<ReplayList classroomReplayStore={classroomReplayStore} />
40+
return (
41+
<div className="replay-container">
42+
{windowsBtn && (
43+
<TopBar
44+
showWindowsSystemBtn={windowsBtn.showWindowsBtn}
45+
onClickWindowsSystemBtn={windowsBtn.onClickWindowsSystemBtn}
46+
onDoubleClick={windowsBtn.clickWindowMaximize}
47+
/>
48+
)}
49+
<div className="replay-videos is-horizontal">
50+
<ReplayVideo classroomReplayStore={classroomReplayStore} />
5951
</div>
52+
<div className="replay-content">
53+
<ReplayWhiteboard classroomReplayStore={classroomReplayStore} />
54+
<div className="replay-share-screen">{/* TODO */}</div>
55+
<div
56+
className={classNames("replay-bottom", {
57+
"is-playing": classroomReplayStore.isPlaying,
58+
})}
59+
>
60+
<ReplayList classroomReplayStore={classroomReplayStore} />
61+
</div>
62+
</div>
63+
<ExitReplayConfirm
64+
visible={showExitReplayModal}
65+
onCancel={() => setShowExitReplayModal(false)}
66+
onConfirm={() => history.goBack()}
67+
onSendWindowWillClose={() => setShowExitReplayModal(true)}
68+
/>
6069
</div>
61-
<ExitReplayConfirm
62-
visible={showExitReplayModal}
63-
onCancel={() => setShowExitReplayModal(false)}
64-
onConfirm={() => history.goBack()}
65-
onSendWindowWillClose={() => setShowExitReplayModal(true)}
66-
/>
67-
</div>
68-
);
69-
});
70+
);
71+
}),
72+
);
7073

7174
export default ReplayPage;

0 commit comments

Comments
 (0)