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
6040948f
Commit
6040948f
authored
Dec 21, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add CardModal component
parent
d174c541
Pipeline
#18745
passed with stages
in 5 minutes and 21 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
5 deletions
+55
-5
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+3
-0
src/ui/Duel/simpleDuel/cardModal.tsx
src/ui/Duel/simpleDuel/cardModal.tsx
+43
-0
src/ui/Duel/simpleDuel/mod.tsx
src/ui/Duel/simpleDuel/mod.tsx
+9
-5
No files found.
src/reducers/duel/mod.ts
View file @
6040948f
...
@@ -77,6 +77,9 @@ export const {
...
@@ -77,6 +77,9 @@ export const {
clearHandsInteractivity
,
clearHandsInteractivity
,
addHandsInteractivity
,
addHandsInteractivity
,
updateTimeLimit
,
updateTimeLimit
,
setCardModalIsOpen
,
setCardModalText
,
setCardModalImgUrl
,
}
=
duelSlice
.
actions
;
}
=
duelSlice
.
actions
;
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
meInitInfo
!=
null
;
return
state
.
duel
.
meInitInfo
!=
null
;
...
...
src/ui/Duel/simpleDuel/cardModal.tsx
0 → 100644
View file @
6040948f
import
React
from
"
react
"
;
import
{
useAppSelector
}
from
"
../../../hook
"
;
import
{
store
}
from
"
../../../store
"
;
import
{
selectCardModalIsOpen
,
selectCardModalName
,
selectCardModalDesc
,
selectCardModalImgUrl
,
}
from
"
../../../reducers/duel/modal
"
;
import
{
setCardModalIsOpen
}
from
"
../../../reducers/duel/mod
"
;
import
{
Modal
,
Card
}
from
"
antd
"
;
const
{
Meta
}
=
Card
;
const
CARD_WIDTH
=
240
;
const
CardModal
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
const
isOpen
=
useAppSelector
(
selectCardModalIsOpen
);
const
name
=
useAppSelector
(
selectCardModalName
);
const
desc
=
useAppSelector
(
selectCardModalDesc
);
const
imgUrl
=
useAppSelector
(
selectCardModalImgUrl
);
const
handleOkOrCancel
=
()
=>
{
dispatch
(
setCardModalIsOpen
(
false
));
};
return
(
<>
<
Modal
open=
{
isOpen
}
onOk=
{
handleOkOrCancel
}
onCancel=
{
handleOkOrCancel
}
>
<
Card
hoverable
style=
{
{
width
:
CARD_WIDTH
}
}
cover=
{
<
img
alt=
{
name
}
src=
{
imgUrl
}
/>
}
>
<
Meta
title=
{
name
}
/>
<
p
>
{
desc
}
</
p
>
</
Card
>
</
Modal
>
</>
);
};
export
default
CardModal
;
src/ui/Duel/simpleDuel/mod.tsx
View file @
6040948f
...
@@ -20,6 +20,7 @@ import * as CONFIG from "../../../config/ui";
...
@@ -20,6 +20,7 @@ import * as CONFIG from "../../../config/ui";
import
{
Card
}
from
"
../../../reducers/duel/util
"
;
import
{
Card
}
from
"
../../../reducers/duel/util
"
;
import
{
selectCurrentPlayer
}
from
"
../../../reducers/duel/turnSlice
"
;
import
{
selectCurrentPlayer
}
from
"
../../../reducers/duel/turnSlice
"
;
import
{
selectCurrentPhase
}
from
"
../../../reducers/duel/phaseSlice
"
;
import
{
selectCurrentPhase
}
from
"
../../../reducers/duel/phaseSlice
"
;
import
CardModal
from
"
./cardModal
"
;
// CONFIG
// CONFIG
...
@@ -136,11 +137,14 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
...
@@ -136,11 +137,14 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
},
[]);
},
[]);
return
(
return
(
<
canvas
<>
width=
{
window
.
innerWidth
}
<
canvas
height=
{
window
.
innerHeight
}
width=
{
window
.
innerWidth
}
ref=
{
canvasRef
}
height=
{
window
.
innerHeight
}
/>
ref=
{
canvasRef
}
/>
<
CardModal
/>
</>
);
);
}
}
...
...
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