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
e22f5b60
Commit
e22f5b60
authored
May 14, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use EffectButton in CardListModal
parent
3fd5151f
Pipeline
#21658
passed with stages
in 12 minutes and 19 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
23 deletions
+16
-23
src/ui/Duel/Message/CardListModal.tsx
src/ui/Duel/Message/CardListModal.tsx
+13
-22
src/ui/Duel/Message/EffectButton.tsx
src/ui/Duel/Message/EffectButton.tsx
+3
-1
No files found.
src/ui/Duel/Message/CardListModal.tsx
View file @
e22f5b60
import
{
Button
,
Drawer
,
List
}
from
"
antd
"
;
import
{
Drawer
,
List
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
clearAllIdleInteractivities
as
clearAllIdleInteractivities
,
messageStore
,
}
from
"
@/stores
"
;
import
{
messageStore
}
from
"
@/stores
"
;
import
{
EffectButton
}
from
"
./EffectButton
"
;
const
NeosConfig
=
useConfig
();
...
...
@@ -16,9 +14,9 @@ const CARD_WIDTH = 100;
const
{
cardListModal
}
=
messageStore
;
export
const
CardListModal
=
()
=>
{
const
snap
CardListModal
=
useSnapshot
(
cardListModal
);
const
isOpen
=
snap
CardListModal
.
isOpen
;
const
list
=
snap
CardListModal
.
list
as
typeof
cardListModal
.
list
;
const
snap
=
useSnapshot
(
cardListModal
);
const
isOpen
=
snap
.
isOpen
;
const
list
=
snap
.
list
as
typeof
cardListModal
.
list
;
const
handleOkOrCancel
=
()
=>
{
cardListModal
.
isOpen
=
false
;
...
...
@@ -31,19 +29,12 @@ export const CardListModal = () => {
dataSource=
{
list
}
renderItem=
{
(
item
)
=>
(
<
List
.
Item
actions=
{
item
.
interactivies
.
map
((
interactivy
,
idx
)
=>
(
<
Button
key=
{
idx
}
onClick=
{
()
=>
{
sendSelectIdleCmdResponse
(
interactivy
.
response
);
cardListModal
.
isOpen
=
false
;
clearAllIdleInteractivities
(
0
);
clearAllIdleInteractivities
(
1
);
}
}
>
{
interactivy
.
desc
}
</
Button
>
))
}
actions=
{
[
<
EffectButton
effectInteractivies=
{
item
.
interactivies
}
meta=
{
item
.
meta
}
/>,
]
}
extra=
{
<
img
alt=
{
item
.
meta
?.
text
.
name
}
...
...
src/ui/Duel/Message/EffectButton.tsx
View file @
e22f5b60
import
React
from
"
react
"
;
import
"
@/styles/card-modal.scss
"
;
import
React
from
"
react
"
;
import
{
CardMeta
,
getCardStr
,
sendSelectIdleCmdResponse
}
from
"
@/api
"
;
import
{
clearAllIdleInteractivities
as
clearAllIdleInteractivities
,
...
...
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