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
203fc54b
Commit
203fc54b
authored
Jan 02, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add CheckCardModal
parent
5c298ffe
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
0 deletions
+90
-0
src/reducers/duel/modalSlice.ts
src/reducers/duel/modalSlice.ts
+10
-0
src/ui/Duel/checkCardModal.tsx
src/ui/Duel/checkCardModal.tsx
+78
-0
src/ui/Duel/main.tsx
src/ui/Duel/main.tsx
+2
-0
No files found.
src/reducers/duel/modalSlice.ts
View file @
203fc54b
...
...
@@ -206,3 +206,13 @@ export const selectCardListModalIsOpen = (state: RootState) =>
state
.
duel
.
modalState
.
cardListModal
.
isOpen
;
export
const
selectCardListModalInfo
=
(
state
:
RootState
)
=>
state
.
duel
.
modalState
.
cardListModal
.
list
;
export
const
selectCheckCardModalIsOpen
=
(
state
:
RootState
)
=>
state
.
duel
.
modalState
.
checkCardModal
.
isOpen
;
export
const
selectCheckCardModalMinMax
=
(
state
:
RootState
)
=>
{
return
{
min
:
state
.
duel
.
modalState
.
checkCardModal
.
selectMin
||
0
,
max
:
state
.
duel
.
modalState
.
checkCardModal
.
selectMax
||
0
,
};
};
export
const
selectCheckCardModalTags
=
(
state
:
RootState
)
=>
state
.
duel
.
modalState
.
checkCardModal
.
tags
;
src/ui/Duel/checkCardModal.tsx
0 → 100644
View file @
203fc54b
import
React
,
{
useState
}
from
"
react
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
store
}
from
"
../../store
"
;
import
{
selectCheckCardModalIsOpen
,
selectCheckCardModalMinMax
,
selectCheckCardModalTags
,
}
from
"
../../reducers/duel/modalSlice
"
;
import
{
resetCheckCardModal
,
setCheckCardModalIsOpen
,
}
from
"
../../reducers/duel/mod
"
;
import
{
Modal
,
Button
,
Row
,
Col
}
from
"
antd
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
sendSelectCardResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
const
CheckCardModal
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
const
isOpen
=
useAppSelector
(
selectCheckCardModalIsOpen
);
const
{
min
,
max
}
=
useAppSelector
(
selectCheckCardModalMinMax
);
const
tabs
=
useAppSelector
(
selectCheckCardModalTags
);
const
[
response
,
setResponse
]
=
useState
<
number
[]
>
([]);
const
defaultValue
:
number
[]
=
[];
return
(
<
Modal
title=
{
`请选择${min}到${max}张卡片`
}
open=
{
isOpen
}
closable=
{
false
}
footer=
{
null
}
>
<
CheckCard
.
Group
multiple
bordered
defaultValue=
{
defaultValue
}
onChange=
{
(
value
)
=>
{
// @ts-ignore
setResponse
(
value
);
}
}
>
{
tabs
.
map
((
tab
)
=>
{
return
(
<
Row
>
{
tab
.
options
.
map
((
option
)
=>
{
return
(
<
Col
span=
{
5
}
>
<
CheckCard
title=
{
option
.
name
}
description=
{
option
.
desc
}
cover=
{
<
img
alt=
{
option
.
code
.
toString
()
}
src=
{
`https://cdn02.moecube.com:444/images/ygopro-images-zh-CN/${option.code}.jpg`
}
/>
}
value=
{
option
.
response
}
/>
</
Col
>
);
})
}
</
Row
>
);
})
}
</
CheckCard
.
Group
>
<
Button
title=
"完成"
disabled=
{
response
.
length
<
min
||
response
.
length
>
max
}
onClick=
{
()
=>
{
sendSelectCardResponse
(
response
);
dispatch
(
setCheckCardModalIsOpen
(
false
));
dispatch
(
resetCheckCardModal
());
}
}
/>
</
Modal
>
);
};
export
default
CheckCardModal
;
src/ui/Duel/main.tsx
View file @
203fc54b
...
...
@@ -13,6 +13,7 @@ import Deck from "./deck";
import
Exclusion
from
"
./exclusion
"
;
import
Cemeteries
from
"
./cemetery
"
;
import
CardListModal
from
"
./cardListModal
"
;
import
CheckCardModal
from
"
./checkCardModal
"
;
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const
NeosDuel
=
()
=>
(
...
...
@@ -40,6 +41,7 @@ const NeosDuel = () => (
<
CardModal
/>
<
CardListModal
/>
<
HintNotification
/>
<
CheckCardModal
/>
</>
);
...
...
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