community: fix tic-tac-toe wrong turn bug (#2524)

This commit is contained in:
Rishichandra Wawhal
2019-07-12 18:07:10 +05:30
committed by Shahidh K Muhammed
parent 88a1be4a04
commit f3808bc9ba

View File

@@ -89,7 +89,7 @@ const Play = ({boardId, client}) => {
status= <h2 style={{color: isSelfWinner ? 'green' : 'red'}}>{winner}</h2>
} else {
if (board.turn === 'x') {
status = <h2 style={{color: isSelfUser1 ? 'green' : '#565656'}}>{isSelfUser1 ? 'Your' : `${board.user1.name}'s`} turn</h2>
status = <h2 style={{color: isSelfUser1 ? 'green' : '#565656'}}>{isSelfUser1 ? 'Your' : `${board.user2.name}'s`} turn</h2>
} else {
status = <h2 style={{color: !isSelfUser1 ? 'green' : '#565656'}}>{!isSelfUser1 ? 'Your' : `${board.user1.name}'s`} turn</h2>
}
@@ -111,7 +111,7 @@ const Play = ({boardId, client}) => {
</div>
<div className="display-flex-center">
<div className="width-300 text-align-center">{opponent}</div>
</div>
</div>
</div>
)
}
@@ -120,4 +120,4 @@ const Play = ({boardId, client}) => {
)
};
export default withApollo(Play);
export default withApollo(Play);