Fixing "your turn" notification.

master
Thomas Hintz 5 years ago
parent 48b178327b
commit 1f5b1e1eae

@ -1995,6 +1995,8 @@ class BoardApp extends React.Component {
} }
actionShowing = () => { actionShowing = () => {
window.actionRef = this.actionRef;
window.actionRefExtra = this.actionRefExtra;
return (this.actionRef && this.actionRef.offsetParent) || return (this.actionRef && this.actionRef.offsetParent) ||
(this.actionRefExtra && this.actionRefExtra.offsetParent) (this.actionRefExtra && this.actionRefExtra.offsetParent)
} }
@ -2222,22 +2224,6 @@ class BoardApp extends React.Component {
</AlertOverlay> </AlertOverlay>
); );
} }
const actionComponent = (
<Action
currentPlayer={this.state.currentPlayer}
timerId={this.state.timerId}
setTimerId={this.setTimerId}
forwardRef={x => this.actionRef = x}
spaces={this.props.spaces}
player={this.props.player}
game={this.props.game}
movePlayer={this.props.movePlayer}
showNextAction={this.props.nextUIAction}
otherPlayersTurn={this.props.player.name !== this.props.game.currentPlayer}
screen={this.state.screen}
showScreen={screen => this.showScreen(screen)}
setMovingSkip={this.props.setMovingSkip}
ui={this.props.ui} />);
// faExchangeAlt -> trade icon, hidden for now // faExchangeAlt -> trade icon, hidden for now
return ( return (
<div className='game-container' ref={this.myRef}> <div className='game-container' ref={this.myRef}>
@ -2273,7 +2259,21 @@ class BoardApp extends React.Component {
game={this.props.game} showScreen={this.showScreen} /> game={this.props.game} showScreen={this.showScreen} />
</div> </div>
<div className={this.tabClass(SCREENS.action)}> <div className={this.tabClass(SCREENS.action)}>
{actionComponent} <Action
currentPlayer={this.state.currentPlayer}
timerId={this.state.timerId}
setTimerId={this.setTimerId}
forwardRef={x => this.actionRef = x}
spaces={this.props.spaces}
player={this.props.player}
game={this.props.game}
movePlayer={this.props.movePlayer}
showNextAction={this.props.nextUIAction}
otherPlayersTurn={this.props.player.name !== this.props.game.currentPlayer}
screen={this.state.screen}
showScreen={screen => this.showScreen(screen)}
setMovingSkip={this.props.setMovingSkip}
ui={this.props.ui} />
</div> </div>
<div className={this.tabClass(SCREENS.cards)}> <div className={this.tabClass(SCREENS.cards)}>
<Row> <Row>
@ -2321,7 +2321,21 @@ class BoardApp extends React.Component {
</div> </div>
<div className='static-tab-container show-for-large'> <div className='static-tab-container show-for-large'>
<div className='tab show'> <div className='tab show'>
{actionComponent} <Action
currentPlayer={this.state.currentPlayer}
timerId={this.state.timerId}
setTimerId={this.setTimerId}
forwardRef={x => this.actionRefExtra = x}
spaces={this.props.spaces}
player={this.props.player}
game={this.props.game}
movePlayer={this.props.movePlayer}
showNextAction={this.props.nextUIAction}
otherPlayersTurn={this.props.player.name !== this.props.game.currentPlayer}
screen={this.state.screen}
showScreen={screen => this.showScreen(screen)}
setMovingSkip={this.props.setMovingSkip}
ui={this.props.ui} />
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save