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
f7d3771d
Commit
f7d3771d
authored
Apr 29, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add onBlockClick
parent
bad1375c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
7 deletions
+27
-7
src/ui/Duel/PlayMat2/Block.tsx
src/ui/Duel/PlayMat2/Block.tsx
+27
-7
No files found.
src/ui/Duel/PlayMat2/Block.tsx
View file @
f7d3771d
...
@@ -3,7 +3,8 @@ import "@/styles/mat.css";
...
@@ -3,7 +3,8 @@ import "@/styles/mat.css";
import
classnames
from
"
classnames
"
;
import
classnames
from
"
classnames
"
;
import
React
,
{
MouseEventHandler
}
from
"
react
"
;
import
React
,
{
MouseEventHandler
}
from
"
react
"
;
import
{
CardState
,
DuelFieldState
}
from
"
@/stores
"
;
import
{
CardState
,
clearAllPlaceInteradtivities
,
DuelFieldState
}
from
"
@/stores
"
;
import
{
sendSelectPlaceResponse
}
from
"
@/api
"
;
export
const
Block
:
React
.
FC
<
{
export
const
Block
:
React
.
FC
<
{
isExtra
?:
boolean
;
isExtra
?:
boolean
;
...
@@ -43,7 +44,7 @@ export function BlockRow<T extends DuelFieldState>(props: {
...
@@ -43,7 +44,7 @@ export function BlockRow<T extends DuelFieldState>(props: {
{
props
.
leftState
?
(
{
props
.
leftState
?
(
<
Block
<
Block
highlight=
{
props
.
leftState
.
placeInteractivity
!==
undefined
}
highlight=
{
props
.
leftState
.
placeInteractivity
!==
undefined
}
onClick=
{
()
=>
{}
}
onClick=
{
()
=>
{
onBlockClick
(
props
.
leftState
!
);
}
}
outerLeft
outerLeft
/>
/>
)
:
(
)
:
(
...
@@ -54,14 +55,16 @@ export function BlockRow<T extends DuelFieldState>(props: {
...
@@ -54,14 +55,16 @@ export function BlockRow<T extends DuelFieldState>(props: {
key=
{
idx
}
key=
{
idx
}
highlight=
{
block
.
placeInteractivity
!==
undefined
}
highlight=
{
block
.
placeInteractivity
!==
undefined
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
// TODO
onBlockClick
(
block
);
}
}
}
}
/>
/>
))
}
))
}
{
props
.
rightState
?
(
{
props
.
rightState
?
(
<
Block
<
Block
highlight=
{
props
.
rightState
.
placeInteractivity
!==
undefined
}
highlight=
{
props
.
rightState
.
placeInteractivity
!==
undefined
}
onClick=
{
()
=>
{}
}
onClick=
{
()
=>
{
onBlockClick
(
props
.
rightState
!
);
}
}
outerRight
outerRight
/>
/>
)
:
(
)
:
(
...
@@ -84,6 +87,12 @@ export const ExtraBlockRow: React.FC<{
...
@@ -84,6 +87,12 @@ export const ExtraBlockRow: React.FC<{
opLeft
.
placeInteractivity
!==
undefined
opLeft
.
placeInteractivity
!==
undefined
}
}
isExtra=
{
true
}
isExtra=
{
true
}
onClick=
{
()
=>
{
onBlockClick
(
meLeft
);
onBlockClick
(
opLeft
);
}
}
/>
/>
<
Block
<
Block
highlight=
{
highlight=
{
...
@@ -91,9 +100,20 @@ export const ExtraBlockRow: React.FC<{
...
@@ -91,9 +100,20 @@ export const ExtraBlockRow: React.FC<{
opRight
.
placeInteractivity
!==
undefined
opRight
.
placeInteractivity
!==
undefined
}
}
isExtra=
{
true
}
isExtra=
{
true
}
onClick=
{
()
=>
{
onClick=
{
// TODO
()
=>
{
}
}
onBlockClick
(
meRight
);
onBlockClick
(
opRight
);
}
}
/>
/>
</
div
>
</
div
>
);
);
const
onBlockClick
=
(
state
:
CardState
)
=>
{
if
(
state
.
placeInteractivity
)
{
sendSelectPlaceResponse
(
state
.
placeInteractivity
.
response
);
clearAllPlaceInteradtivities
(
0
);
clearAllPlaceInteradtivities
(
1
);
}
}
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