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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
love_飞影
Neos
Commits
b3ac1939
Commit
b3ac1939
authored
Jun 28, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
render selectes in SelectCardsModal
parent
f26da02e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
16 deletions
+38
-16
src/ui/Duel/Message/SelectCardsModal/index.tsx
src/ui/Duel/Message/SelectCardsModal/index.tsx
+38
-16
No files found.
src/ui/Duel/Message/SelectCardsModal/index.tsx
View file @
b3ac1939
...
@@ -2,7 +2,7 @@ import "./index.scss";
...
@@ -2,7 +2,7 @@ import "./index.scss";
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Segmented
,
Space
,
Tooltip
}
from
"
antd
"
;
import
{
Button
,
Segmented
,
Space
,
Tooltip
}
from
"
antd
"
;
import
{
useEffect
,
useState
}
from
"
react
"
;
import
{
CSSProperties
,
useEffect
,
useState
}
from
"
react
"
;
import
{
INTERNAL_Snapshot
as
Snapshot
,
useSnapshot
}
from
"
valtio
"
;
import
{
INTERNAL_Snapshot
as
Snapshot
,
useSnapshot
}
from
"
valtio
"
;
import
type
{
CardMeta
,
ygopro
}
from
"
@/api
"
;
import
type
{
CardMeta
,
ygopro
}
from
"
@/api
"
;
...
@@ -14,6 +14,21 @@ import { groupBy } from "../../utils";
...
@@ -14,6 +14,21 @@ import { groupBy } from "../../utils";
import
{
showCardModal
}
from
"
../CardModal
"
;
import
{
showCardModal
}
from
"
../CardModal
"
;
import
{
NeosModal
}
from
"
../NeosModal
"
;
import
{
NeosModal
}
from
"
../NeosModal
"
;
const
YgoCardStyle
=
{
width
:
"
100%
"
,
height
:
"
100%
"
,
position
:
"
absolute
"
,
left
:
0
,
top
:
0
,
};
const
CheckCardStyle
=
{
width
:
100
,
aspectRatio
:
5.9
/
8.6
,
marginInlineEnd
:
0
,
marginBlockEnd
:
0
,
flexShrink
:
0
,
};
export
interface
SelectCardsModalProps
{
export
interface
SelectCardsModalProps
{
isOpen
:
boolean
;
isOpen
:
boolean
;
min
:
number
;
min
:
number
;
...
@@ -36,7 +51,7 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
...
@@ -36,7 +51,7 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
min
,
min
,
max
,
max
,
single
,
single
,
selecteds
:
_selecteds
,
selecteds
,
selectables
,
selectables
,
mustSelects
,
mustSelects
,
cancelable
,
cancelable
,
...
@@ -164,22 +179,10 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
...
@@ -164,22 +179,10 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
cover=
{
cover=
{
<
YgoCard
<
YgoCard
code=
{
card
.
meta
.
id
}
code=
{
card
.
meta
.
id
}
style=
{
{
style=
{
YgoCardStyle
as
CSSProperties
}
width
:
"
100%
"
,
height
:
"
100%
"
,
position
:
"
absolute
"
,
left
:
0
,
top
:
0
,
}
}
/>
/>
}
}
style=
{
{
style=
{
CheckCardStyle
}
width
:
100
,
aspectRatio
:
5.9
/
8.6
,
marginInlineEnd
:
0
,
marginBlockEnd
:
0
,
flexShrink
:
0
,
}
}
value=
{
card
}
value=
{
card
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
showCardModal
(
card
);
showCardModal
(
card
);
...
@@ -192,6 +195,25 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
...
@@ -192,6 +195,25 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
</
div
>
</
div
>
)
)
)
}
)
}
<
p
>
{
selecteds
.
length
>
0
?
fetchStrings
(
"
!system
"
,
212
)
:
""
}
</
p
>
{
selecteds
.
map
((
card
,
i
)
=>
(
<
Tooltip
title=
{
card
.
effectDesc
}
placement=
"bottom"
key=
{
i
}
>
<
div
>
<
CheckCard
cover=
{
<
YgoCard
code=
{
card
.
meta
.
id
}
style=
{
YgoCardStyle
as
CSSProperties
}
/>
}
style=
{
CheckCardStyle
}
onClick=
{
()
=>
{
showCardModal
(
card
);
}
}
/>
</
div
>
</
Tooltip
>
))
}
</
Space
>
</
Space
>
</
div
>
</
div
>
</
NeosModal
>
</
NeosModal
>
...
...
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