Commit 714bed00 authored by Chunchi Che's avatar Chunchi Che

add WatchModal

parent 6f7de7c1
Pipeline #23633 passed with stages
in 12 minutes and 54 seconds
import { Modal } from "antd";
import React from "react";
import { proxy, useSnapshot } from "valtio";
const localStore = proxy({
open: false,
});
export const WatchModal: React.FC = () => {
const { open } = useSnapshot(localStore);
return (
<Modal
title="观看回放"
open={open}
centered
footer={<></>}
onCancel={() => (localStore.open = false)}
></Modal>
);
};
export const watchOpen = () => (localStore.open = true);
...@@ -18,6 +18,7 @@ import styles from "./index.module.scss"; ...@@ -18,6 +18,7 @@ import styles from "./index.module.scss";
import { MatchModal, matchStore } from "./MatchModal"; import { MatchModal, matchStore } from "./MatchModal";
import { ReplayModal, replayOpen } from "./ReplayModal"; import { ReplayModal, replayOpen } from "./ReplayModal";
import { connectSrvpro } from "./util"; import { connectSrvpro } from "./util";
import { WatchModal, watchOpen } from "./WatchModal";
const NeosConfig = useConfig(); const NeosConfig = useConfig();
...@@ -77,9 +78,6 @@ export const Component: React.FC = () => { ...@@ -77,9 +78,6 @@ export const Component: React.FC = () => {
// 自定义房间 // 自定义房间
const onCustomRoom = () => (matchStore.open = true); const onCustomRoom = () => (matchStore.open = true);
// 观战列表
const onWatchList = () => message.error("开发中,敬请期待");
useEffect(() => { useEffect(() => {
if (joined) { if (joined) {
setSingleLoading(false); setSingleLoading(false);
...@@ -145,7 +143,7 @@ export const Component: React.FC = () => { ...@@ -145,7 +143,7 @@ export const Component: React.FC = () => {
title="MC观战列表" title="MC观战列表"
desc="观看萌卡MyCard上正在进行的决斗。" desc="观看萌卡MyCard上正在进行的决斗。"
icon={<PlayCircleFilled />} icon={<PlayCircleFilled />}
onClick={onWatchList} onClick={watchOpen}
/> />
<Mode <Mode
title="单人模式" title="单人模式"
...@@ -176,6 +174,7 @@ export const Component: React.FC = () => { ...@@ -176,6 +174,7 @@ export const Component: React.FC = () => {
</div> </div>
<MatchModal /> <MatchModal />
<ReplayModal /> <ReplayModal />
<WatchModal />
</> </>
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment