summaryrefslogtreecommitdiff
path: root/sw-ui/src/main/kotlin
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@booking.com>2020-05-31 18:27:21 +0200
committerJoffrey Bion <joffrey.bion@booking.com>2020-05-31 18:27:21 +0200
commit5b998fc16944fbec2d3fd1f0e4aa8b077f98e412 (patch)
tree4826c78d7db84f5bb9c65ae5cb6ac16434271190 /sw-ui/src/main/kotlin
parentDisplay assigned wonder in Lobby (diff)
downloadseven-wonders-5b998fc16944fbec2d3fd1f0e4aa8b077f98e412.tar.gz
seven-wonders-5b998fc16944fbec2d3fd1f0e4aa8b077f98e412.tar.bz2
seven-wonders-5b998fc16944fbec2d3fd1f0e4aa8b077f98e412.zip
Use blueprint CSS from CDN instead of local copy
Diffstat (limited to 'sw-ui/src/main/kotlin')
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameBrowser.kt8
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt35
2 files changed, 28 insertions, 15 deletions
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameBrowser.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameBrowser.kt
index 2f860ca7..ab7b3bac 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameBrowser.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameBrowser.kt
@@ -1,9 +1,15 @@
package org.luxons.sevenwonders.ui.components.gameBrowser
+import kotlinx.css.*
import react.RBuilder
import react.dom.*
+import styled.css
+import styled.styledDiv
-fun RBuilder.gameBrowser() = div {
+fun RBuilder.gameBrowser() = styledDiv {
+ css {
+ margin(all = 1.rem)
+ }
h1 { +"Games" }
createGameForm {}
gameList()
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt
index 2fbb75a5..9043537c 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt
@@ -5,6 +5,7 @@ import com.palantir.blueprintjs.bpButton
import com.palantir.blueprintjs.bpNonIdealState
import kotlinx.css.*
import kotlinx.css.properties.*
+import kotlinx.html.DIV
import org.luxons.sevenwonders.model.api.LobbyDTO
import org.luxons.sevenwonders.model.api.PlayerDTO
import org.luxons.sevenwonders.ui.redux.RequestAddBot
@@ -43,23 +44,29 @@ class LobbyPresenter(props: LobbyProps) : RComponent<LobbyProps, RState>(props)
bpNonIdealState(icon = "error", title = "Error: no current game")
return
}
- div {
+ styledDiv {
+ css {
+ margin(1.rem)
+ }
h2 { +"${currentGame.name} — Lobby" }
radialPlayerList(currentGame.players, currentPlayer)
+ actionButtons(currentPlayer, currentGame)
+ }
+ }
- styledDiv {
- css {
- position = Position.fixed
- bottom = 2.rem
- left = 50.pct
- transform { translate((-50).pct) }
- }
- if (currentPlayer.isGameOwner) {
- startButton(currentGame, currentPlayer)
- addBotButton(currentGame)
- } else {
- leaveButton()
- }
+ private fun RDOMBuilder<DIV>.actionButtons(currentPlayer: PlayerDTO, currentGame: LobbyDTO) {
+ styledDiv {
+ css {
+ position = Position.fixed
+ bottom = 2.rem
+ left = 50.pct
+ transform { translate((-50).pct) }
+ }
+ if (currentPlayer.isGameOwner) {
+ startButton(currentGame, currentPlayer)
+ addBotButton(currentGame)
+ } else {
+ leaveButton()
}
}
}
bgstack15