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
No related branches found
No related tags found
No related merge requests found
......@@ -5,10 +5,12 @@ import api.Api
import api.Machine
import app.softwork.bootstrapcompose.Container
import org.jetbrains.compose.web.css.*
import org.jetbrains.compose.web.dom.Div
@Composable
fun content() {
val data by remember { mutableStateOf(Api.getOnce()) }
var machine by remember { mutableStateOf<Machine?>(null) }
Container(attrs = {
style {
......@@ -17,15 +19,25 @@ fun content() {
flexWrap(FlexWrap.Wrap)
justifyContent(JustifyContent.Center)
paddingTop(1.em)
paddingBottom(12.em)
}
}) {
var machine by remember { mutableStateOf<Machine?>(null) }
data.floors.forEach {
floor(it, 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