Skip to content
Snippets Groups Projects
Commit 6fc36a1c authored by Tóth Miklós Tibor's avatar Tóth Miklós Tibor :shrug:
Browse files

Add dynamic spacer

parent db0d8c9e
Branches
No related tags found
No related merge requests found
...@@ -5,10 +5,12 @@ import api.Api ...@@ -5,10 +5,12 @@ import api.Api
import api.Machine import api.Machine
import app.softwork.bootstrapcompose.Container import app.softwork.bootstrapcompose.Container
import org.jetbrains.compose.web.css.* import org.jetbrains.compose.web.css.*
import org.jetbrains.compose.web.dom.Div
@Composable @Composable
fun content() { fun content() {
val data by remember { mutableStateOf(Api.getOnce()) } val data by remember { mutableStateOf(Api.getOnce()) }
var machine by remember { mutableStateOf<Machine?>(null) }
Container(attrs = { Container(attrs = {
style { style {
...@@ -17,15 +19,25 @@ fun content() { ...@@ -17,15 +19,25 @@ fun content() {
flexWrap(FlexWrap.Wrap) flexWrap(FlexWrap.Wrap)
justifyContent(JustifyContent.Center) justifyContent(JustifyContent.Center)
paddingTop(1.em) paddingTop(1.em)
paddingBottom(12.em)
} }
}) { }) {
var machine by remember { mutableStateOf<Machine?>(null) }
data.floors.forEach { data.floors.forEach {
floor(it, machine) { m -> floor(it, machine) { m ->
machine = m machine = m
} }
} }
} }
Div(attrs = {
style {
width(0.px)
if (machine != null) {
height(17.em)
} else {
height(0.em)
}
property("transition", "height 0.75s")
}
}) {}
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment