Commit fef2e9b4 authored by Chunchi Che's avatar Chunchi Che

add ChatBox

parent bc9d35df
Pipeline #23500 passed with stages
in 13 minutes and 10 seconds
...@@ -19,6 +19,7 @@ import { ...@@ -19,6 +19,7 @@ import {
YesNoModal, YesNoModal,
} from "./Message"; } from "./Message";
import { LifeBar, Mat, Menu, Underlying } from "./PlayMat"; import { LifeBar, Mat, Menu, Underlying } from "./PlayMat";
import { ChatBox } from "./PlayMat/ChatBox";
export const Component: React.FC = () => { export const Component: React.FC = () => {
const { stage } = useSnapshot(sideStore); const { stage } = useSnapshot(sideStore);
...@@ -57,6 +58,7 @@ export const Component: React.FC = () => { ...@@ -57,6 +58,7 @@ export const Component: React.FC = () => {
<SortCardModal /> <SortCardModal />
<SimpleSelectCardsModal /> <SimpleSelectCardsModal />
<EndModal /> <EndModal />
<ChatBox />
</> </>
); );
}; };
......
.chatbox {
position: relative;
height: 50% !important;
width: 80% !important;
left: 10%;
bottom: -40%;
border-radius: 6px;
:global(.ant-drawer-header) {
padding: 8px 4px;
}
}
import { DownOutlined } from "@ant-design/icons";
import { Drawer } from "antd";
import React from "react";
import { proxy, useSnapshot } from "valtio";
import styles from "./index.module.scss";
const store = proxy({ open: false });
export const ChatBox: React.FC = () => {
const { open } = useSnapshot(store);
const onClose = () => (store.open = false);
return (
<Drawer
open={open}
placement="bottom"
mask={false}
className={styles.chatbox}
onClose={onClose}
closeIcon={<DownOutlined />}
></Drawer>
);
};
export const openChatBox = () => (store.open = true);
...@@ -29,6 +29,7 @@ import { IconFont } from "@/ui/Shared"; ...@@ -29,6 +29,7 @@ import { IconFont } from "@/ui/Shared";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
import PhaseType = ygopro.StocGameMessage.MsgNewPhase.PhaseType; import PhaseType = ygopro.StocGameMessage.MsgNewPhase.PhaseType;
import { openChatBox } from "../ChatBox";
const { phase: store } = matStore; const { phase: store } = matStore;
const { useToken } = theme; const { useToken } = theme;
...@@ -170,7 +171,11 @@ export const Menu = () => { ...@@ -170,7 +171,11 @@ export const Menu = () => {
></Button> ></Button>
</DropdownWithTitle> </DropdownWithTitle>
<Tooltip title="聊天室"> <Tooltip title="聊天室">
<Button icon={<MessageFilled />} type="text"></Button> <Button
icon={<MessageFilled />}
onClick={openChatBox}
type="text"
></Button>
</Tooltip> </Tooltip>
<DropdownWithTitle <DropdownWithTitle
title="是否投降?" title="是否投降?"
......
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