File tree Expand file tree Collapse file tree 3 files changed +38
-26
lines changed Expand file tree Collapse file tree 3 files changed +38
-26
lines changed Original file line number Diff line number Diff line change @@ -149,21 +149,29 @@ export const HandBrainPlayControls: React.FC<Props> = ({
149
149
{ offerDraw ? (
150
150
< button
151
151
onClick = { offerDraw }
152
- className = "flex w-full justify-center rounded bg-engine-3 py-2 text-primary transition duration-200 hover:bg-engine-4"
152
+ disabled = { ! playerActive }
153
+ className = { `flex w-full justify-center rounded px-4 py-2 text-primary transition duration-200 ${
154
+ playerActive
155
+ ? 'bg-engine-3 hover:bg-engine-4'
156
+ : 'cursor-not-allowed bg-background-2 text-primary/50'
157
+ } `}
153
158
>
154
159
< p className = "font-medium uppercase tracking-wide" >
155
160
Offer draw
156
161
</ p >
157
162
</ button >
158
163
) : null }
159
- { resign ? (
160
- < button
161
- onClick = { resign }
162
- className = "flex w-full justify-center rounded bg-human-3 px-4 py-1.5 text-primary transition duration-200 hover:bg-human-4"
163
- >
164
- < p className = "text-sm font-medium" > Resign</ p >
165
- </ button >
166
- ) : null }
164
+ < button
165
+ onClick = { resign }
166
+ disabled = { ! resign || ! playerActive }
167
+ className = { `flex w-full justify-center rounded px-4 py-1.5 text-primary transition duration-200 ${
168
+ resign && playerActive
169
+ ? 'bg-human-3 hover:bg-human-4'
170
+ : 'cursor-not-allowed bg-background-2 text-primary/50'
171
+ } `}
172
+ >
173
+ < p className = "text-sm font-medium" > Resign</ p >
174
+ </ button >
167
175
</ div >
168
176
) }
169
177
</ div >
Original file line number Diff line number Diff line change @@ -86,19 +86,27 @@ export const PlayControls: React.FC<Props> = ({
86
86
{ offerDraw ? (
87
87
< button
88
88
onClick = { offerDraw }
89
- className = "flex w-full items-center justify-center rounded bg-engine-3 py-2 transition duration-200 hover:bg-engine-4"
89
+ disabled = { ! playerActive }
90
+ className = { `flex w-full items-center justify-center rounded px-4 py-2 transition duration-200 ${
91
+ playerActive
92
+ ? 'bg-engine-3 hover:bg-engine-4'
93
+ : 'cursor-not-allowed bg-background-2 text-primary/50'
94
+ } `}
90
95
>
91
96
< p className = "font-medium uppercase tracking-wide" > Offer draw</ p >
92
97
</ button >
93
98
) : null }
94
- { resign ? (
95
- < button
96
- onClick = { resign }
97
- className = "flex items-center justify-center rounded bg-human-3 px-4 py-1.5 transition duration-200 hover:bg-human-4"
98
- >
99
- < p className = "text-sm font-medium" > Resign</ p >
100
- </ button >
101
- ) : null }
99
+ < button
100
+ onClick = { resign }
101
+ disabled = { ! resign || ! playerActive }
102
+ className = { `flex items-center justify-center rounded px-4 py-1.5 transition duration-200 ${
103
+ resign && playerActive
104
+ ? 'bg-human-3 hover:bg-human-4'
105
+ : 'cursor-not-allowed bg-background-2 text-primary/50'
106
+ } `}
107
+ >
108
+ < p className = "text-sm font-medium" > Resign</ p >
109
+ </ button >
102
110
</ div >
103
111
) }
104
112
</ div >
Original file line number Diff line number Diff line change @@ -60,14 +60,10 @@ const PlayMaia: React.FC<Props> = ({
60
60
game = { controller . game }
61
61
playerActive = { controller . playerActive }
62
62
gameOver = { ! ! controller . game . termination }
63
- resign = {
64
- controller . playerActive
65
- ? ( ) => {
66
- controller . updateClock ( )
67
- controller . setResigned ( true )
68
- }
69
- : undefined
70
- }
63
+ resign = { ( ) => {
64
+ controller . updateClock ( )
65
+ controller . setResigned ( true )
66
+ } }
71
67
playAgain = { playAgain }
72
68
simulateMaiaTime = { simulateMaiaTime }
73
69
setSimulateMaiaTime = { setSimulateMaiaTime }
You can’t perform that action at this time.
0 commit comments