Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
a05bea12
Commit
a05bea12
authored
Mar 30, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update checkCardModal.tsx
parent
21cd9e99
Pipeline
#21011
passed with stages
in 22 minutes and 20 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
60 deletions
+38
-60
src/ui/Duel/checkCardModal.tsx
src/ui/Duel/checkCardModal.tsx
+38
-60
No files found.
src/ui/Duel/checkCardModal.tsx
View file @
a05bea12
...
...
@@ -13,15 +13,14 @@ import {
resetCheckCardModal
,
setCheckCardModalIsOpen
,
}
from
"
../../reducers/duel/mod
"
;
import
{
Modal
,
Button
,
Row
,
Col
,
Popover
}
from
"
antd
"
;
import
{
Button
,
Row
,
Col
,
Popover
}
from
"
antd
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
sendSelectCardResponse
,
sendSelectChainResponse
,
}
from
"
../../api/ocgcore/ocgHelper
"
;
import
type
{
DraggableData
,
DraggableEvent
}
from
"
react-draggable
"
;
import
Draggable
from
"
react-draggable
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
import
DragModal
from
"
./dragModal
"
;
const
CheckCardModal
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
...
...
@@ -36,27 +35,7 @@ const CheckCardModal = () => {
// Draggable 相关
const
[
draggable
,
setDraggable
]
=
useState
(
false
);
const
[
bounds
,
setBounds
]
=
useState
({
left
:
0
,
top
:
0
,
bottom
:
0
,
right
:
0
,
});
const
draggleRef
=
useRef
<
HTMLDivElement
>
(
null
);
const
onStart
=
(
_event
:
DraggableEvent
,
uiData
:
DraggableData
)
=>
{
const
{
clientWidth
,
clientHeight
}
=
window
.
document
.
documentElement
;
const
targetRect
=
draggleRef
.
current
?.
getBoundingClientRect
();
if
(
!
targetRect
)
{
return
;
}
setBounds
({
left
:
-
targetRect
.
left
+
uiData
.
x
,
right
:
clientWidth
-
(
targetRect
.
right
-
uiData
.
x
),
top
:
-
targetRect
.
top
+
uiData
.
y
,
bottom
:
clientHeight
-
(
targetRect
.
bottom
-
uiData
.
y
),
});
};
const
onMouseOver
=
()
=>
{
if
(
draggable
)
{
setDraggable
(
false
);
...
...
@@ -86,11 +65,12 @@ const CheckCardModal = () => {
};
return
(
<
Modal
title=
{
`请选择${min}到${max}张卡片`
}
open=
{
isOpen
}
closable=
{
false
}
footer=
{
<
DragModal
modalProps=
{
{
title
:
`请选择${min}到${max}张卡片`
,
open
:
isOpen
,
closable
:
false
,
footer
:
(
<>
<
Button
disabled=
{
response
.
length
<
min
||
response
.
length
>
max
}
...
...
@@ -126,13 +106,11 @@ const CheckCardModal = () => {
<></>
)
}
</>
}
modalRender=
{
(
modal
)
=>
(
<
Draggable
disabled=
{
!
draggable
}
bounds=
{
bounds
}
onStart=
{
onStart
}
>
<
div
ref=
{
draggleRef
}
>
{
modal
}
</
div
>
</
Draggable
>
)
}
width=
{
800
}
),
width
:
800
,
}
}
dragRef=
{
draggleRef
}
draggable=
{
draggable
}
>
<
CheckCard
.
Group
multiple
...
...
@@ -181,7 +159,7 @@ const CheckCardModal = () => {
);
})
}
</
CheckCard
.
Group
>
</
Modal
>
</
Drag
Modal
>
);
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment