diff --git a/src/components/BoardView.tsx b/src/components/BoardView.tsx index 866ff92..7bb1b05 100644 --- a/src/components/BoardView.tsx +++ b/src/components/BoardView.tsx @@ -5,7 +5,9 @@ import { Hole, Store, Game } from '../mancala'; type Theme = { background : string, boardColor: string + boardColorWhenPlayerTurn: string storeColor: string + storeColorWhenPlayerTurn: string holeColor: string ballColor: string } @@ -13,7 +15,9 @@ type Theme = { const theme: Theme = { background : "#EEEEEE", boardColor: "#4D606E", + boardColorWhenPlayerTurn: "#84b8a6", storeColor: "#3FBAC2", + storeColorWhenPlayerTurn: "#6cab94", holeColor: "#D3D4D8", ballColor: "#393E46", } @@ -93,6 +97,10 @@ const BoardView: FunctionComponent<{ game?: Game, userKey: string, onHoleSelect: }} /> )) + const isUserTurn = game.checkGameTurn(userKey); + + const storeColor = isUserTurn ? theme.storeColor : theme.storeColorWhenPlayerTurn; + return (