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