File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { BaseGame } from 'src/types'
2+
13interface Props {
4+ game : BaseGame
25 playerActive : boolean
36 gameOver : boolean
47 resign ?: ( ) => void
@@ -7,6 +10,7 @@ interface Props {
710}
811
912export const PlayControls : React . FC < Props > = ( {
13+ game,
1014 playerActive,
1115 gameOver,
1216 resign,
@@ -16,13 +20,25 @@ export const PlayControls: React.FC<Props> = ({
1620 return (
1721 < div >
1822 { gameOver ? (
19- < div className = "flex flex-col p-4 text-center" >
23+ < div className = "flex flex-col gap-2 p-4 text-center" >
24+ { game . id ? (
25+ < button
26+ onClick = { ( ) => {
27+ window . open ( `/analysis/${ game . id } /play` , '_blank' )
28+ } }
29+ className = "flex items-center justify-center rounded bg-engine-3 py-2 transition duration-200 hover:bg-engine-4"
30+ >
31+ < p className = "font-medium uppercase tracking-wide" >
32+ Analyze game
33+ </ p >
34+ </ button >
35+ ) : null }
2036 { playAgain ? (
2137 < button
2238 onClick = { playAgain }
2339 className = "flex items-center justify-center rounded bg-human-3 py-2 transition duration-200 hover:bg-human-4"
2440 >
25- < p className = "text-lg " > Play again</ p >
41+ < p className = "font-medium uppercase tracking-wide " > Play again</ p >
2642 </ button >
2743 ) : null }
2844 </ div >
Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ const PlayMaia: React.FC<Props> = ({
194194 < PlayControllerContext . Provider value = { controller } >
195195 < GameplayInterface >
196196 < PlayControls
197+ game = { controller . game }
197198 playerActive = { controller . playerActive }
198199 gameOver = { ! ! controller . game . termination }
199200 resign = {
You can’t perform that action at this time.
0 commit comments