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
baichixing
Neos
Commits
535b3e8b
Commit
535b3e8b
authored
Jan 01, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add CardListModal component
parent
6a1f6c80
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
26 deletions
+77
-26
src/ui/Duel/cardListModal.tsx
src/ui/Duel/cardListModal.tsx
+51
-0
src/ui/Duel/cardModal.tsx
src/ui/Duel/cardModal.tsx
+24
-26
src/ui/Duel/main.tsx
src/ui/Duel/main.tsx
+2
-0
No files found.
src/ui/Duel/cardListModal.tsx
0 → 100644
View file @
535b3e8b
import
React
from
"
react
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
store
}
from
"
../../store
"
;
import
{
selectCardListModalIsOpen
,
selectCardListModalInfo
,
}
from
"
../../reducers/duel/modalSlice
"
;
import
{
setCardListModalIsOpen
}
from
"
../../reducers/duel/mod
"
;
import
{
Modal
,
List
,
Popover
,
Card
}
from
"
antd
"
;
const
{
Meta
}
=
Card
;
const
CARD_WIDTH
=
100
;
const
CardListModal
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
const
isOpen
=
useAppSelector
(
selectCardListModalIsOpen
);
const
list
=
useAppSelector
(
selectCardListModalInfo
);
const
handleOkOrCancel
=
()
=>
{
dispatch
(
setCardListModalIsOpen
(
false
));
};
return
(
<
Modal
open=
{
isOpen
}
onOk=
{
handleOkOrCancel
}
onCancel=
{
handleOkOrCancel
}
>
<
List
itemLayout=
"horizontal"
dataSource=
{
list
}
renderItem=
{
(
item
)
=>
(
<
Popover
content=
{
<
Card
hoverable
style=
{
{
width
:
CARD_WIDTH
}
}
cover=
{
<
img
alt=
{
item
.
name
}
src=
{
item
.
imgUrl
}
/>
}
>
<
Meta
title=
{
item
.
name
}
/>
<
p
>
{
item
.
desc
}
</
p
>
</
Card
>
}
>
<
List
.
Item
>
<
List
.
Item
.
Meta
title=
{
item
.
name
}
description=
{
item
.
desc
}
/>
</
List
.
Item
>
</
Popover
>
)
}
></
List
>
</
Modal
>
);
};
export
default
CardListModal
;
src/ui/Duel/cardModal.tsx
View file @
535b3e8b
...
@@ -31,32 +31,30 @@ const CardModal = () => {
...
@@ -31,32 +31,30 @@ const CardModal = () => {
};
};
return
(
return
(
<>
<
Modal
open=
{
isOpen
}
onOk=
{
handleOkOrCancel
}
onCancel=
{
handleOkOrCancel
}
>
<
Modal
open=
{
isOpen
}
onOk=
{
handleOkOrCancel
}
onCancel=
{
handleOkOrCancel
}
>
<
Card
<
Card
hoverable
hoverable
style=
{
{
width
:
CARD_WIDTH
}
}
style=
{
{
width
:
CARD_WIDTH
}
}
cover=
{
<
img
alt=
{
name
}
src=
{
imgUrl
}
/>
}
cover=
{
<
img
alt=
{
name
}
src=
{
imgUrl
}
/>
}
>
>
<
Meta
title=
{
name
}
/>
<
Meta
title=
{
name
}
/>
<
p
>
{
desc
}
</
p
>
<
p
>
{
desc
}
</
p
>
</
Card
>
</
Card
>
{
interactivies
.
map
((
interactive
,
idx
)
=>
{
{
interactivies
.
map
((
interactive
,
idx
)
=>
{
return
(
return
(
<
Button
<
Button
key=
{
idx
}
key=
{
idx
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
sendSelectIdleCmdResponse
(
interactive
.
response
);
sendSelectIdleCmdResponse
(
interactive
.
response
);
dispatch
(
setCardModalIsOpen
(
false
));
dispatch
(
setCardModalIsOpen
(
false
));
dispatch
(
clearHandsInteractivity
(
0
));
dispatch
(
clearHandsInteractivity
(
0
));
}
}
}
}
>
>
{
interactive
.
desc
}
{
interactive
.
desc
}
</
Button
>
</
Button
>
);
);
})
}
})
}
</
Modal
>
</
Modal
>
</>
);
);
};
};
...
...
src/ui/Duel/main.tsx
View file @
535b3e8b
...
@@ -12,6 +12,7 @@ import Field from "./field";
...
@@ -12,6 +12,7 @@ import Field from "./field";
import
Deck
from
"
./deck
"
;
import
Deck
from
"
./deck
"
;
import
Exclusion
from
"
./exclusion
"
;
import
Exclusion
from
"
./exclusion
"
;
import
Cemeteries
from
"
./cemetery
"
;
import
Cemeteries
from
"
./cemetery
"
;
import
CardListModal
from
"
./cardListModal
"
;
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const
NeosDuel
=
()
=>
(
const
NeosDuel
=
()
=>
(
...
@@ -37,6 +38,7 @@ const NeosDuel = () => (
...
@@ -37,6 +38,7 @@ const NeosDuel = () => (
)
}
)
}
</
ReactReduxContext
.
Consumer
>
</
ReactReduxContext
.
Consumer
>
<
CardModal
/>
<
CardModal
/>
<
CardListModal
/>
<
HintNotification
/>
<
HintNotification
/>
</>
</>
);
);
...
...
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