Test commit

This commit is contained in:
Mizanali Panjwani 2021-02-17 05:42:40 +05:30
parent 690fc5e1d3
commit ac6dee77bc

View File

@ -6,37 +6,38 @@ import './Game.css'
const Game = (props) => { const Game = (props) => {
const player1active = props.turn === 'Player 1' const player1active = props.turn === 'Player 1'
return ( // return (
props.gameOver ? <div><h1>GAME FORFEITED</h1>{props.winner !== '' && <><h1>GAME OVER</h1><h2>{props.winner} wins!</h2></>}<a href='/'>Home</a></div> : // props.gameOver ? <div><h1>GAME FORFEITED</h1>{props.winner !== '' && <><h1>GAME OVER</h1><h2>{props.winner} wins!</h2></>}<a href='/'>Home</a></div> :
<div className='Game'> // <div className='Game'>
<h1>Turn: {props.turn}</h1> // <h1>Turn: {props.turn}</h1>
<div className='player1Deck' style={player1active ? null : {pointerEvents: 'none'}}> // <div className='player1Deck' style={player1active ? null : {pointerEvents: 'none'}}>
{props.player1Deck.map((item) => ( // {props.player1Deck.map((item) => (
<span // <span
onClick={() => props.onCardPlayed(item)} // onClick={() => props.onCardPlayed(item)}
className='card'> // className='card'>
{item} // {item}
</span> // </span>
))} // ))}
</div> // </div>
<hr /> // <hr />
<div> // <div>
<h1>Current Card: {props.playedCardsPile[props.playedCardsPile.length-1]}</h1> // <h1>Current Card: {props.playedCardsPile[props.playedCardsPile.length-1]}</h1>
<button onClick={props.onCardDrawn}>DRAW CARD</button> // <button onClick={props.onCardDrawn}>DRAW CARD</button>
</div> // </div>
<hr /> // <hr />
<div className='player2Deck' style={player1active ? {pointerEvents: 'none'} : null}> // <div className='player2Deck' style={player1active ? {pointerEvents: 'none'} : null}>
{props.player2Deck.map((item) => ( // {props.player2Deck.map((item) => (
<span // <span
onClick={() => props.onCardPlayed(item)} // onClick={() => props.onCardPlayed(item)}
className='card'> // className='card'>
{item} // {item}
</span> // </span>
))} // ))}
</div> // </div>
<a href='/'>Home</a> // <a href='/'>Home</a>
</div> // </div>
) // )
return null
} }
const mapStateToProps = (state) => { const mapStateToProps = (state) => {