Skip to content

Commit

Permalink
fix(flat-pages): register apps in replay page (#1893)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious authored Apr 17, 2023
1 parent d7422e7 commit e15fe90
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export const Overview: Story<AppearancePickerProps> = args => (
</Router>
);
Overview.args = {
defaultValue: "light",
value: "light",
};
81 changes: 42 additions & 39 deletions packages/flat-pages/src/ReplayPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,60 @@ import { useLoginCheck } from "../utils/use-login-check";
import { ReplayList } from "./ReplayList";
import { ReplayVideo } from "./ReplayVideo";
import { ReplayWhiteboard } from "./ReplayWhiteboard";
import { withFlatServices } from "../components/FlatServicesContext";

export type ReplayPageProps = RouteComponentProps<{
roomUUID: string;
ownerUUID: string;
roomType: RoomType;
}>;

export const ReplayPage = observer<ReplayPageProps>(function ReplayPage({ match }) {
useLoginCheck();
export const ReplayPage = withFlatServices("whiteboard")(
observer<ReplayPageProps>(function ReplayPage({ match }) {
useLoginCheck();

const history = useHistory();
const classroomReplayStore = useClassroomReplayStore(match.params);
const [showExitReplayModal, setShowExitReplayModal] = useState(false);
const history = useHistory();
const classroomReplayStore = useClassroomReplayStore(match.params);
const [showExitReplayModal, setShowExitReplayModal] = useState(false);

const windowsBtn = useContext(WindowsSystemBtnContext);
const windowsBtn = useContext(WindowsSystemBtnContext);

if (!classroomReplayStore) {
return <LoadingPage />;
}
if (!classroomReplayStore) {
return <LoadingPage />;
}

return (
<div className="replay-container">
{windowsBtn && (
<TopBar
showWindowsSystemBtn={windowsBtn.showWindowsBtn}
onClickWindowsSystemBtn={windowsBtn.onClickWindowsSystemBtn}
onDoubleClick={windowsBtn.clickWindowMaximize}
/>
)}
<div className="replay-videos is-horizontal">
<ReplayVideo classroomReplayStore={classroomReplayStore} />
</div>
<div className="replay-content">
<ReplayWhiteboard classroomReplayStore={classroomReplayStore} />
<div className="replay-share-screen">{/* TODO */}</div>
<div
className={classNames("replay-bottom", {
"is-playing": classroomReplayStore.isPlaying,
})}
>
<ReplayList classroomReplayStore={classroomReplayStore} />
return (
<div className="replay-container">
{windowsBtn && (
<TopBar
showWindowsSystemBtn={windowsBtn.showWindowsBtn}
onClickWindowsSystemBtn={windowsBtn.onClickWindowsSystemBtn}
onDoubleClick={windowsBtn.clickWindowMaximize}
/>
)}
<div className="replay-videos is-horizontal">
<ReplayVideo classroomReplayStore={classroomReplayStore} />
</div>
<div className="replay-content">
<ReplayWhiteboard classroomReplayStore={classroomReplayStore} />
<div className="replay-share-screen">{/* TODO */}</div>
<div
className={classNames("replay-bottom", {
"is-playing": classroomReplayStore.isPlaying,
})}
>
<ReplayList classroomReplayStore={classroomReplayStore} />
</div>
</div>
<ExitReplayConfirm
visible={showExitReplayModal}
onCancel={() => setShowExitReplayModal(false)}
onConfirm={() => history.goBack()}
onSendWindowWillClose={() => setShowExitReplayModal(true)}
/>
</div>
<ExitReplayConfirm
visible={showExitReplayModal}
onCancel={() => setShowExitReplayModal(false)}
onConfirm={() => history.goBack()}
onSendWindowWillClose={() => setShowExitReplayModal(true)}
/>
</div>
);
});
);
}),
);

export default ReplayPage;

0 comments on commit e15fe90

Please sign in to comment.