From 1f5b1e1eae6fbd7af6b56e73b0a12553fa527b4c Mon Sep 17 00:00:00 2001 From: Thomas Hintz Date: Mon, 27 Apr 2020 21:06:54 -0700 Subject: [PATCH] Fixing "your turn" notification. --- src/components/farm/Board.jsx | 50 ++++++++++++++++++++++------------- 1 file 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 { ); } - const actionComponent = ( - 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 (
@@ -2273,7 +2259,21 @@ class BoardApp extends React.Component { game={this.props.game} showScreen={this.showScreen} />
- {actionComponent} + 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} />
@@ -2321,7 +2321,21 @@ class BoardApp extends React.Component {
- {actionComponent} + 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} />