This commit is contained in:
Mizanali Panjwani 2021-02-23 19:25:40 +05:30
parent 0d6a5c166c
commit 9cde81b6f9

View File

@ -700,7 +700,8 @@ const Game = (props) => {
} }
return ( return (
(!roomFull) ? <> <>
{(!roomFull) ? <>
<h1>Game Code: {room}</h1> <h1>Game Code: {room}</h1>
{users.length===2 ? <> {users.length===2 ? <>
@ -729,7 +730,7 @@ const Game = (props) => {
/> } /> }
</div> </div>
<hr /> <hr />
<div className='player2Deck' style={turn === 'Player 1' ? {pointerEvents: 'none'} : null}> <div className='player2Deck' style={{pointerEvents: 'none'}}>
{player2Deck.map((item) => ( {player2Deck.map((item) => (
<img <img
onClick={() => onCardPlayedHandler(item)} onClick={() => onCardPlayedHandler(item)}
@ -741,7 +742,7 @@ const Game = (props) => {
</div> </> } </div> </> }
{currentUser === 'Player 2' && <> {currentUser === 'Player 2' && <>
<div className='player1Deck' style={turn === 'Player 1' ? null : {pointerEvents: 'none'}}> <div className='player1Deck' style={{pointerEvents: 'none'}}>
{player1Deck.map((item) => ( {player1Deck.map((item) => (
<img <img
onClick={() => onCardPlayedHandler(item)} onClick={() => onCardPlayedHandler(item)}
@ -771,13 +772,15 @@ const Game = (props) => {
<button onClick={onCardDrawnHandler}>DRAW CARD</button> <button onClick={onCardDrawnHandler}>DRAW CARD</button>
</div> </> } </div> </> }
<hr />
<a href='/'>Home</a>
</div> } </div> }
</> : <h1>Waiting for other player</h1> } </> : <h1>Waiting for other player</h1> }
</> : <h1>Room full</h1> </> : <h1>Room full</h1> }
<hr />
<a href='/'>Home</a>
</>
) )
} }