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
b8477ec2
Commit
b8477ec2
authored
Mar 30, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update optionModal.tsx
parent
44329d94
Pipeline
#21015
passed with stages
in 16 minutes and 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
21 deletions
+27
-21
src/ui/Duel/optionModal.tsx
src/ui/Duel/optionModal.tsx
+27
-21
No files found.
src/ui/Duel/optionModal.tsx
View file @
b8477ec2
import
React
,
{
useState
}
from
"
react
"
;
import
React
,
{
use
Ref
,
use
State
}
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
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
import
{
selectOptionModalIsOpen
,
selectOptionModalIsOpen
,
...
@@ -12,32 +12,38 @@ import {
...
@@ -12,32 +12,38 @@ import {
resetOptionModal
,
resetOptionModal
,
setOptionModalIsOpen
,
setOptionModalIsOpen
,
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
import
DragModal
from
"
./dragModal
"
;
const
OptionModal
=
()
=>
{
const
OptionModal
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
const
dispatch
=
store
.
dispatch
;
const
isOpen
=
useAppSelector
(
selectOptionModalIsOpen
);
const
isOpen
=
useAppSelector
(
selectOptionModalIsOpen
);
const
options
=
useAppSelector
(
selectOptionModalOptions
);
const
options
=
useAppSelector
(
selectOptionModalOptions
);
const
[
selected
,
setSelected
]
=
useState
<
number
|
undefined
>
(
undefined
);
const
[
selected
,
setSelected
]
=
useState
<
number
|
undefined
>
(
undefined
);
const
draggleRef
=
useRef
<
HTMLDivElement
>
(
null
);
return
(
return
(
<
Modal
<
DragModal
title=
"请选择需要发动的效果"
modalProps=
{
{
open=
{
isOpen
}
title
:
"
请选择需要发动的效果
"
,
closable=
{
false
}
open
:
isOpen
,
footer=
{
closable
:
false
,
<
Button
footer
:
(
disabled=
{
selected
===
undefined
}
<
Button
onClick=
{
()
=>
{
disabled=
{
selected
===
undefined
}
if
(
selected
!==
undefined
)
{
onClick=
{
()
=>
{
sendSelectOptionResponse
(
selected
);
if
(
selected
!==
undefined
)
{
dispatch
(
setOptionModalIsOpen
(
false
));
sendSelectOptionResponse
(
selected
);
dispatch
(
resetOptionModal
());
dispatch
(
setOptionModalIsOpen
(
false
));
}
dispatch
(
resetOptionModal
());
}
}
}
>
}
}
submit
>
</
Button
>
submit
}
</
Button
>
),
}
}
dragRef=
{
draggleRef
}
draggable=
{
true
}
>
>
<
CheckCard
.
Group
<
CheckCard
.
Group
bordered
bordered
...
@@ -51,7 +57,7 @@ const OptionModal = () => {
...
@@ -51,7 +57,7 @@ const OptionModal = () => {
<
CheckCard
key=
{
idx
}
title=
{
option
.
msg
}
value=
{
option
.
response
}
/>
<
CheckCard
key=
{
idx
}
title=
{
option
.
msg
}
value=
{
option
.
response
}
/>
))
}
))
}
</
CheckCard
.
Group
>
</
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