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 player1active = props.turn === 'Player 1'
return (
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'>
<h1>Turn: {props.turn}</h1>
<div className='player1Deck' style={player1active ? null : {pointerEvents: 'none'}}>
{props.player1Deck.map((item) => (
<span
onClick={() => props.onCardPlayed(item)}
className='card'>
{item}
</span>
))}
</div>
<hr />
<div>
<h1>Current Card: {props.playedCardsPile[props.playedCardsPile.length-1]}</h1>
<button onClick={props.onCardDrawn}>DRAW CARD</button>
</div>
<hr />
<div className='player2Deck' style={player1active ? {pointerEvents: 'none'} : null}>
{props.player2Deck.map((item) => (
<span
onClick={() => props.onCardPlayed(item)}
className='card'>
{item}
</span>
))}
</div>
<a href='/'>Home</a>
</div>
)
// return (
// 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'>
// <h1>Turn: {props.turn}</h1>
// <div className='player1Deck' style={player1active ? null : {pointerEvents: 'none'}}>
// {props.player1Deck.map((item) => (
// <span
// onClick={() => props.onCardPlayed(item)}
// className='card'>
// {item}
// </span>
// ))}
// </div>
// <hr />
// <div>
// <h1>Current Card: {props.playedCardsPile[props.playedCardsPile.length-1]}</h1>
// <button onClick={props.onCardDrawn}>DRAW CARD</button>
// </div>
// <hr />
// <div className='player2Deck' style={player1active ? {pointerEvents: 'none'} : null}>
// {props.player2Deck.map((item) => (
// <span
// onClick={() => props.onCardPlayed(item)}
// className='card'>
// {item}
// </span>
// ))}
// </div>
// <a href='/'>Home</a>
// </div>
// )
return null
}
const mapStateToProps = (state) => {