bugfix resign button existence #11
This commit is contained in:
@@ -24,7 +24,7 @@ class UserControl extends React.Component {
|
||||
}
|
||||
|
||||
onClickBombSelector(clickedPlayer) {
|
||||
var activePlayer = this.state.activePlayer ? 'blue' : 'red';
|
||||
let activePlayer = this.state.activePlayer ? 'blue' : 'red';
|
||||
|
||||
if (this.youCanSelectBomb(activePlayer, clickedPlayer)) {
|
||||
this.state.bombSelected = !this.state.bombSelected;
|
||||
@@ -35,6 +35,11 @@ class UserControl extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
getResignClass(webPlayer) {
|
||||
let activePlayer = this.state.activePlayer === 1 ? 'blue' : 'red';
|
||||
return "resign" + (webPlayer !== activePlayer ? ' disabled' : '');
|
||||
}
|
||||
|
||||
activeMines() {
|
||||
return "active-mines" + (this.state.foundMines ? ' found-mine' : '');
|
||||
}
|
||||
@@ -61,10 +66,10 @@ class UserControl extends React.Component {
|
||||
webPlayer={this.props.webPlayer}
|
||||
active={this.state.activePlayer === 0}
|
||||
onClickBombSelector={this.onClickBombSelector.bind(this, 0)}/>
|
||||
<div className="resign">
|
||||
<button className={this.getResignClass(this.props.webPlayer)}>
|
||||
<div className="resign-shine"></div>
|
||||
Resign
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user