summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hintz <t@thintz.com>2020-04-27 21:06:54 -0700
committerThomas Hintz <t@thintz.com>2020-04-27 21:06:54 -0700
commit1f5b1e1eae6fbd7af6b56e73b0a12553fa527b4c (patch)
tree83bf0eb2c3421fc38152737ac5a3a80a64fc05e2
parent48b178327b5914e3a475a4c57319ff514f527827 (diff)
downloadfarm-1f5b1e1eae6fbd7af6b56e73b0a12553fa527b4c.tar.gz
Fixing "your turn" notification.
-rw-r--r--src/components/farm/Board.jsx50
1 files changed, 32 insertions, 18 deletions
diff --git a/src/components/farm/Board.jsx b/src/components/farm/Board.jsx
index 24553f3..dc05838 100644
--- a/src/components/farm/Board.jsx
+++ b/src/components/farm/Board.jsx
@@ -1995,6 +1995,8 @@ class BoardApp extends React.Component {
}
actionShowing = () => {
+ window.actionRef = this.actionRef;
+ window.actionRefExtra = this.actionRefExtra;
return (this.actionRef && this.actionRef.offsetParent) ||
(this.actionRefExtra && this.actionRefExtra.offsetParent)
}
@@ -2222,22 +2224,6 @@ class BoardApp extends React.Component {
</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
return (
<div className='game-container' ref={this.myRef}>
@@ -2273,7 +2259,21 @@ class BoardApp extends React.Component {
game={this.props.game} showScreen={this.showScreen} />
</div>
<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 className={this.tabClass(SCREENS.cards)}>
<Row>
@@ -2321,7 +2321,21 @@ class BoardApp extends React.Component {
</div>
<div className='static-tab-container show-for-large'>
<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>