Commit 44329d94 authored by Chunchi Che's avatar Chunchi Che

update

parent dd4107f0
Pipeline #21014 passed with stages
in 20 minutes and 49 seconds
import React from "react"; import React, { useRef } from "react";
import { useAppSelector } from "../../hook"; import { useAppSelector } from "../../hook";
import { store } from "../../store"; import { store } from "../../store";
import { Modal, Button } from "antd"; import { Button } from "antd";
import { sendSelectEffectYnResponse } from "../../api/ocgcore/ocgHelper"; import { sendSelectEffectYnResponse } from "../../api/ocgcore/ocgHelper";
import { import {
selectYesNoModalIsOpen, selectYesNoModalIsOpen,
selectYesNOModalMsg, selectYesNOModalMsg,
} from "../../reducers/duel/modal/mod"; } from "../../reducers/duel/modal/mod";
import { setYesNoModalIsOpen } from "../../reducers/duel/mod"; import { setYesNoModalIsOpen } from "../../reducers/duel/mod";
import DragModal from "./dragModal";
const YesNoModal = () => { const YesNoModal = () => {
const dispatch = store.dispatch; const dispatch = store.dispatch;
const isOpen = useAppSelector(selectYesNoModalIsOpen); const isOpen = useAppSelector(selectYesNoModalIsOpen);
const msg = useAppSelector(selectYesNOModalMsg); const msg = useAppSelector(selectYesNOModalMsg);
// Draggable 相关
const draggleRef = useRef<HTMLDivElement>(null);
return ( return (
<Modal <DragModal
title={msg} modalProps={{
open={isOpen} title: msg,
closable={false} open: isOpen,
footer={ closable: false,
<> footer: (
<Button <>
onClick={() => { <Button
sendSelectEffectYnResponse(true); onClick={() => {
dispatch(setYesNoModalIsOpen(false)); sendSelectEffectYnResponse(true);
}} dispatch(setYesNoModalIsOpen(false));
> }}
Yes >
</Button> Yes
<Button </Button>
onClick={() => { <Button
sendSelectEffectYnResponse(false); onClick={() => {
dispatch(setYesNoModalIsOpen(false)); sendSelectEffectYnResponse(false);
}} dispatch(setYesNoModalIsOpen(false));
> }}
No >
</Button> No
</> </Button>
} </>
),
}}
dragRef={draggleRef}
draggable={true}
/> />
); );
}; };
......
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