summaryrefslogtreecommitdiff
path: root/sw-ui/src/main/kotlin
diff options
context:
space:
mode:
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