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
0f8e3afa
Commit
0f8e3afa
authored
Jun 19, 2023
by
timel
Committed by
Chunchi Che
Jun 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update select action modal
parent
7ace8dc5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
27 deletions
+28
-27
src/ui/Duel/Main.tsx
src/ui/Duel/Main.tsx
+2
-8
src/ui/Duel/Message/NewSelectActionModal/index.tsx
src/ui/Duel/Message/NewSelectActionModal/index.tsx
+26
-19
No files found.
src/ui/Duel/Main.tsx
View file @
0f8e3afa
...
...
@@ -19,13 +19,7 @@ import { NewSelectActionsModal } from "./Message/NewSelectActionModal";
const
NeosDuel
=
()
=>
{
return
(
<>
<
NewSelectActionsModal
isValid
isChain
selecteds=
{
[]
}
selectables=
{
[]
}
mustSelects=
{
[]
}
/>
<
NewSelectActionsModal
/>
<
Alert
/>
<
Menu
/>
<
LifeBar
/>
...
...
@@ -33,7 +27,7 @@ const NeosDuel = () => {
<
CardModal
/>
<
CardListModal
/>
<
HintNotification
/>
<
SelectActionsModal
/>
{
/* <SelectActionsModal /> */
}
<
YesNoModal
/>
<
PositionModal
/>
<
OptionModal
/>
...
...
src/ui/Duel/Message/NewSelectActionModal/index.tsx
View file @
0f8e3afa
...
...
@@ -9,6 +9,7 @@ import {
Segmented
,
Space
,
Typography
,
Tooltip
,
}
from
"
antd
"
;
import
{
type
FC
,
useState
,
useEffect
}
from
"
react
"
;
import
{
useSnapshot
,
proxy
}
from
"
valtio
"
;
...
...
@@ -33,7 +34,6 @@ const FINISH_RESPONSE = -1;
const
defaultProps
=
{
isOpen
:
false
,
title
:
"
是否要进行连锁
"
,
// 模态框标题
isValid
:
false
,
// FIXME 看起来是最小化用的,看情况是否需要删掉
isChain
:
false
,
min
:
0
,
...
...
@@ -52,7 +52,6 @@ const localStore = proxy(defaultProps);
export
const
NewSelectActionsModal
:
FC
=
()
=>
{
const
{
title
,
isOpen
,
isValid
,
isChain
,
...
...
@@ -75,6 +74,8 @@ export const NewSelectActionsModal: FC = () => {
const
preHintMsg
=
hint
?.
esHint
||
""
;
const
selectHintMsg
=
hint
?.
esSelectHint
||
"
请选择卡片
"
;
const
minMaxText
=
min
===
max
?
min
:
`
${
min
}
-
${
max
}
`
;
// 判断是否可以提交
useEffect
(()
=>
{
const
[
sumLevel1
,
sumLevel2
]
=
([
"
level1
"
,
"
level2
"
]
as
const
).
map
((
key
)
=>
...
...
@@ -129,7 +130,13 @@ export const NewSelectActionsModal: FC = () => {
return
(
<
NewModal
title=
{
title
}
title=
{
<>
<
span
>
{
preHintMsg
}
</
span
>
<
span
>
{
selectHintMsg
}
</
span
>
<
span
>
(请选择
{
single
?
1
:
minMaxText
}
张卡)
</
span
>
</>
}
// TODO: 这里可以再细化一些
width=
{
600
}
okButtonProps=
{
{
disabled
:
!
submitable
,
...
...
@@ -172,18 +179,21 @@ export const NewSelectActionsModal: FC = () => {
}
}
>
{
options
[
1
].
map
((
card
,
j
)
=>
(
<
CheckCard
cover=
{
<
YgoCard
code=
{
card
.
meta
.
id
}
/>
}
style=
{
{
width
:
80
,
aspectRatio
:
5.9
/
8.6
,
marginInlineEnd
:
0
,
marginBlockEnd
:
0
,
flexShrink
:
0
,
}
}
key=
{
j
}
value=
{
card
}
/>
<
Tooltip
title=
{
card
.
effectDesc
}
placement=
"bottom"
key=
{
j
}
>
<
div
>
<
CheckCard
cover=
{
<
YgoCard
code=
{
card
.
meta
.
id
}
/>
}
style=
{
{
width
:
80
,
aspectRatio
:
5.9
/
8.6
,
marginInlineEnd
:
0
,
marginBlockEnd
:
0
,
flexShrink
:
0
,
}
}
value=
{
card
}
/>
</
div
>
</
Tooltip
>
))
}
</
CheckCard
.
Group
>
</
div
>
...
...
@@ -231,8 +241,6 @@ const config = useConfig();
let
rs
:
(
v
?:
any
)
=>
void
=
()
=>
{};
type
Result
=
Option
[];
export
const
displaySelectActionsModal
=
async
(
args
:
Partial
<
Omit
<
typeof
defaultProps
,
"
isOpen
"
>>
)
=>
{
...
...
@@ -242,8 +250,7 @@ export const displaySelectActionsModal = async (
// @ts-ignore
localStore
[
key
]
=
value
;
});
await
new
Promise
<
Result
>
((
resolve
)
=>
(
rs
=
resolve
));
// 等待在组件内resolve
console
.
log
(
"
here
"
);
await
new
Promise
<
void
>
((
resolve
)
=>
(
rs
=
resolve
));
// 等待在组件内resolve
localStore
.
isOpen
=
false
;
};
...
...
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