Commit 24a7c1b4 authored by Chunchi Che's avatar Chunchi Che

Merge branch 'fix/auto-return' into 'main'

Fix/auto return

See merge request mycard/Neos!341
parents 091aa5e0 d52e7cdc
Pipeline #25655 passed with stages
in 14 minutes and 55 seconds
...@@ -2,6 +2,7 @@ import { ...@@ -2,6 +2,7 @@ import {
ArrowRightOutlined, ArrowRightOutlined,
CheckOutlined, CheckOutlined,
CloseCircleFilled, CloseCircleFilled,
LogoutOutlined,
MessageFilled, MessageFilled,
StepForwardFilled, StepForwardFilled,
} from "@ant-design/icons"; } from "@ant-design/icons";
...@@ -16,6 +17,7 @@ import { ...@@ -16,6 +17,7 @@ import {
Tooltip, Tooltip,
} from "antd"; } from "antd";
import { cloneElement, useEffect, useState } from "react"; import { cloneElement, useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import { useSnapshot } from "valtio"; import { useSnapshot } from "valtio";
import { import {
...@@ -68,6 +70,8 @@ export const Menu = () => { ...@@ -68,6 +70,8 @@ export const Menu = () => {
[], [],
); );
const navigate = useNavigate();
useEffect(() => { useEffect(() => {
const endResponse = [ const endResponse = [
PhaseType.BATTLE_START, PhaseType.BATTLE_START,
...@@ -147,6 +151,9 @@ export const Menu = () => { ...@@ -147,6 +151,9 @@ export const Menu = () => {
].map((item, i) => ({ key: i, ...item })); ].map((item, i) => ({ key: i, ...item }));
const globalDisable = !matStore.isMe(currentPlayer); const globalDisable = !matStore.isMe(currentPlayer);
const onExit = () => navigate("/match");
return ( return (
<div className={styles["menu-container"]}> <div className={styles["menu-container"]}>
<DropdownWithTitle <DropdownWithTitle
...@@ -185,6 +192,13 @@ export const Menu = () => { ...@@ -185,6 +192,13 @@ export const Menu = () => {
> >
<Button icon={<CloseCircleFilled />} type="text"></Button> <Button icon={<CloseCircleFilled />} type="text"></Button>
</DropdownWithTitle> </DropdownWithTitle>
<Tooltip title="退出页面">
<Button
icon={<LogoutOutlined style={{ color: "red" }} />}
type="text"
onClick={onExit}
></Button>
</Tooltip>
</div> </div>
); );
}; };
......
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