Refactoring

This commit is contained in:
Mizanali Panjwani
2021-02-12 16:01:40 +05:30
parent 663e979e31
commit 8e0294a1e2
3 changed files with 101 additions and 15 deletions

View File

@@ -7,7 +7,8 @@ import './Game.css'
const Game = (props) => {
const player1active = props.turn === 'Player 1'
return (
<div>
props.gameOver ? <div><h1>GAME OVER</h1><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) => (
@@ -32,7 +33,7 @@ const Game = (props) => {
</span>
))}
</div>
<a href='/'>home</a>
<a href='/'>Home</a>
</div>
)
}

View File

@@ -5,7 +5,7 @@ import { connect } from 'react-redux'
const Homepage = (props) => {
return (
<div>
<div className='Homepage'>
<h1>Homepage</h1>
<Link to='/play'><button onClick={props.onStartGame}>START GAME</button></Link>
</div>