bugfix resign button existence #11
This commit is contained in:
@@ -505,6 +505,7 @@ main {
|
||||
background: -ms-linear-gradient(top, rgba(70, 73, 66, 1) 0%, rgba(140, 138, 139, 1) 69%, rgba(96, 89, 97, 1) 100%);
|
||||
background: linear-gradient(to bottom, rgba(70, 73, 66, 1) 0%, rgba(140, 138, 139, 1) 69%, rgba(96, 89, 97, 1) 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#464942', endColorstr='#605961', GradientType=0);
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 95%;
|
||||
height: 50px;
|
||||
@@ -513,11 +514,12 @@ main {
|
||||
font-size: 22px;
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
line-height: 45px;
|
||||
line-height: 40px;
|
||||
border: 3px solid #484742;
|
||||
color: #fff;
|
||||
margin: 10px auto 0 auto;
|
||||
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-border-radius: 5px;
|
||||
|
||||
@@ -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