Commit a242332e authored by Chunchi Che's avatar Chunchi Che

remove unused component

parent cc7fafa5
Pipeline #22099 passed with stages
in 16 minutes and 15 seconds
import { SendOutlined } from "@ant-design/icons";
import { Button, Col, Input, Row } from "antd";
import React, { useState } from "react";
import { sendChat } from "@/api";
export const SendBox = () => {
const [content, setContent] = useState("");
return (
<>
<Row>
<Input.TextArea
placeholder="Message to sent..."
autoSize={{ minRows: 3, maxRows: 4 }}
value={content}
onChange={(e) => {
setContent(e.target.value);
}}
/>
</Row>
<Row>
<Col>
<Button
icon={<SendOutlined />}
onClick={() => {
sendChat(content);
setContent("");
}}
disabled={!content}
/>
</Col>
</Row>
</>
);
};
import { UserOutlined } from "@ant-design/icons";
import { CheckCard } from "@ant-design/pro-components";
import { Avatar } from "antd";
import React from "react";
import { useConfig } from "@/config";
const NeosConfig = useConfig();
const Config = NeosConfig.ui.status;
const avatarSize = 40;
const ME_VALUE = "myself";
const OP_VALUE = "opponent";
import { useSnapshot } from "valtio";
import { matStore } from "@/stores";
export const PlayerStatus = () => {
const meInfo = useSnapshot(matStore.initInfo.me);
const opInfo = useSnapshot(matStore.initInfo.op);
const waiting = useSnapshot(matStore).waiting;
return (
<CheckCard.Group
bordered
style={{ height: `${NeosConfig.ui.layout.header.height}` }}
value={waiting ? OP_VALUE : ME_VALUE}
>
<CheckCard
avatar={
<Avatar
size={avatarSize}
style={{ backgroundColor: Config.opAvatarColor }}
icon={<UserOutlined />}
/>
}
title={OP_VALUE}
description={`Lp: ${opInfo?.life || 0}`}
value={OP_VALUE}
style={{
position: "absolute",
left: `${NeosConfig.ui.layout.sider.width}px`,
}}
/>
<CheckCard
avatar={
<Avatar
size={avatarSize}
style={{ backgroundColor: Config.meAvatarColor }}
icon={<UserOutlined />}
/>
}
title={ME_VALUE}
description={`Lp: ${meInfo?.life || 0}`}
value={ME_VALUE}
style={{
position: "absolute",
right: "0px",
}}
/>
</CheckCard.Group>
);
};
import { MessageOutlined } from "@ant-design/icons";
import { Timeline, TimelineItemProps } from "antd";
import React, { useEffect, useState } from "react";
import { useSnapshot } from "valtio";
import { chatStore } from "@/stores";
export const DuelTimeLine = () => {
const [items, setItems] = useState<TimelineItemProps[]>([]);
const stateChat = chatStore;
const snapChat = useSnapshot(stateChat);
const chat = snapChat.message;
useEffect(() => {
setItems((prev) =>
prev.concat([
{
dot: <MessageOutlined />,
children: chat,
color: "green",
},
])
);
}, [chat]);
return <Timeline items={items} />;
};
......@@ -8,8 +8,5 @@ export * from "./HintNotification";
export * from "./OptionModal";
export * from "./PositionModal";
export * from "./SelectActionsModal";
export * from "./SendBox";
export * from "./SortCardModal";
export * from "./Status";
export * from "./TimeLine";
export * from "./YesNoModal";
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