Commit 71744c0f authored by chechunchi's avatar chechunchi

optimize notification style

parent 9fba97a3
Pipeline #21543 passed with stages
in 17 minutes and 51 seconds
......@@ -6,7 +6,7 @@ import Draggable from "react-draggable";
export interface DragModalProps extends ModalProps {}
const Style = {
const style = {
borderStyle: "groove",
borderRadius: "8px",
backgroundColor: "#303030",
......@@ -39,7 +39,7 @@ export const DragModal = (props: DragModalProps) => {
{...props}
modalRender={(modal) => (
<Draggable bounds={bounds} onStart={onStart}>
<div ref={dragRef} style={Style}>
<div ref={dragRef} style={style}>
{modal}
</div>
</Draggable>
......
......@@ -7,6 +7,12 @@ import { ygopro } from "@/api";
import { useConfig } from "@/config";
import { matStore } from "@/stores";
const style = {
borderStyle: "groove",
borderRadius: "8px",
backgroundColor: "#303030",
};
const MsgWin = ygopro.StocGameMessage.MsgWin;
const NeosConfig = useConfig();
......@@ -19,34 +25,36 @@ export const HintNotification = () => {
const result = snap.result;
const navigate = useNavigate();
const [api, contextHolder] = notification.useNotification({
maxCount: NeosConfig.ui.hint.maxCount,
});
useEffect(() => {
if (hintState && hintState.msg) {
api.info({
api.open({
message: `${hintState.msg}`,
placement: "bottom",
placement: "topLeft",
style: style,
});
}
}, [hintState.msg]);
useEffect(() => {
if (currentPhase) {
api.info({
api.open({
message: `<当前阶段>${currentPhase}`,
placement: "topRight",
style: style,
});
}
}, [currentPhase]);
useEffect(() => {
if (waiting) {
api.info({
api.open({
message: "...等待对方行动中...",
placement: "top",
duration: NeosConfig.ui.hint.waitingDuration,
style: style,
});
}
}, [waiting]);
......@@ -59,9 +67,10 @@ export const HintNotification = () => {
: MsgWin.ActionType.Defeated
? "失败"
: "未知结果";
api.info({
api.open({
message,
placement: "bottom",
style: style,
onClose() {
navigate("/");
},
......
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