mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2026-04-08 18:42:24 +00:00
add Tab support
This commit is contained in:
@@ -4,13 +4,19 @@ import androidx.compose.runtime.Composable
|
||||
import org.jetbrains.compose.web.dom.ContentBuilder
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@Composable
|
||||
inline fun optionallyDraw (
|
||||
vararg bools: Boolean,
|
||||
whatToDraw: @Composable () -> Unit
|
||||
) {
|
||||
if (bools.any { it }) {
|
||||
whatToDraw()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
inline fun <T : Element> optionallyDraw (
|
||||
attrs: Attrs<T>? = null,
|
||||
noinline contentBuilder: ContentBuilder<T>? = null,
|
||||
whatToDraw: @Composable () -> Unit
|
||||
) {
|
||||
if (attrs != null || contentBuilder != null) {
|
||||
whatToDraw()
|
||||
}
|
||||
}
|
||||
) = optionallyDraw(attrs != null || contentBuilder != null, whatToDraw = whatToDraw)
|
||||
|
||||
Reference in New Issue
Block a user