mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2025-11-30 03:15:43 +00:00
add UIKitComment, Comment element, upfill UIKitSubNav
This commit is contained in:
11
src/jsMain/kotlin/dev/inmo/jsuikit/utils/AnyNotNull.kt
Normal file
11
src/jsMain/kotlin/dev/inmo/jsuikit/utils/AnyNotNull.kt
Normal file
@@ -0,0 +1,11 @@
|
||||
package dev.inmo.jsuikit.utils
|
||||
|
||||
fun <T> Array<T>.anyNotNull(): Boolean {
|
||||
for (item in this) {
|
||||
if (item != null) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
16
src/jsMain/kotlin/dev/inmo/jsuikit/utils/OptionallyDraw.kt
Normal file
16
src/jsMain/kotlin/dev/inmo/jsuikit/utils/OptionallyDraw.kt
Normal file
@@ -0,0 +1,16 @@
|
||||
package dev.inmo.jsuikit.utils
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import org.jetbrains.compose.web.dom.ContentBuilder
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@Composable
|
||||
inline fun <T : Element> optionallyDraw (
|
||||
attrs: Attrs<T>? = null,
|
||||
noinline contentBuilder: ContentBuilder<T>? = null,
|
||||
whatToDraw: @Composable () -> Unit
|
||||
) {
|
||||
if (attrs != null || contentBuilder != null) {
|
||||
whatToDraw()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user