diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-22 15:24:19 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-22 15:31:45 +0200 |
commit | 3abcdfa62e99e50255dc09b7f93e33a3b0ab4db0 (patch) | |
tree | a60d6e1c261f5cce1ba14d5af1297af87d0f1f3e /sw-ui/src/main | |
parent | Add BP card component (diff) | |
download | seven-wonders-3abcdfa62e99e50255dc09b7f93e33a3b0ab4db0.tar.gz seven-wonders-3abcdfa62e99e50255dc09b7f93e33a3b0ab4db0.tar.bz2 seven-wonders-3abcdfa62e99e50255dc09b7f93e33a3b0ab4db0.zip |
Move sayReadyButton declaration to a more logical spot
Diffstat (limited to 'sw-ui/src/main')
-rw-r--r-- | sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameScene.kt | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameScene.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameScene.kt index db9c1e4c..06cb5b00 100644 --- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameScene.kt +++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameScene.kt @@ -57,39 +57,6 @@ private class GameScene(props: GameSceneProps) : RComponent<GameSceneProps, RSta } } - private fun RBuilder.sayReadyButton(): ReactElement { - val isReady = props.playerIsReady - val intent = if (isReady) Intent.SUCCESS else Intent.PRIMARY - return styledDiv { - css { - position = Position.absolute - bottom = 6.rem - left = 50.pct - transform { translate(tx = (-50).pct) } - } - bpButtonGroup { - bpButton( - large = true, - disabled = isReady, - intent = intent, - icon = if (isReady) "tick-circle" else "play", - onClick = { props.sayReady() } - ) { - +"READY" - } - // not really a button, but nice for style - bpButton( - large = true, - icon = "people", - disabled = isReady, - intent = intent - ) { - +"${props.players.count { it.isReady }}/${props.players.size}" - } - } - } - } - private fun RBuilder.turnInfoScene(turnInfo: PlayerTurnInfo) { val board = turnInfo.table.boards[turnInfo.playerIndex] div { @@ -189,6 +156,39 @@ private class GameScene(props: GameSceneProps) : RComponent<GameSceneProps, RSta } } } + + private fun RBuilder.sayReadyButton(): ReactElement { + val isReady = props.playerIsReady + val intent = if (isReady) Intent.SUCCESS else Intent.PRIMARY + return styledDiv { + css { + position = Position.absolute + bottom = 6.rem + left = 50.pct + transform { translate(tx = (-50).pct) } + } + bpButtonGroup { + bpButton( + large = true, + disabled = isReady, + intent = intent, + icon = if (isReady) "tick-circle" else "play", + onClick = { props.sayReady() } + ) { + +"READY" + } + // not really a button, but nice for style + bpButton( + large = true, + icon = "people", + disabled = isReady, + intent = intent + ) { + +"${props.players.count { it.isReady }}/${props.players.size}" + } + } + } + } } fun RBuilder.gameScene() = gameScene {} |