Add Preview

This commit is contained in:
Benoit Marty 2025-09-30 12:19:21 +02:00
parent f5df8dcad9
commit 03e92bac25

View file

@ -10,10 +10,14 @@ package io.element.android.libraries.ui.common.nodes
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.bumble.appyx.core.modality.BuildContext import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node import com.bumble.appyx.core.node.Node
import com.bumble.appyx.core.node.node import com.bumble.appyx.core.node.node
import io.element.android.compound.theme.ElementTheme import io.element.android.compound.theme.ElementTheme
import io.element.android.libraries.designsystem.preview.ElementPreview
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
/** /**
* Ref: https://www.figma.com/design/0MMNu7cTOzLOlWb7ctTkv3/Element-X?node-id=1518-85323 * Ref: https://www.figma.com/design/0MMNu7cTOzLOlWb7ctTkv3/Element-X?node-id=1518-85323
@ -21,9 +25,18 @@ import io.element.android.compound.theme.ElementTheme
fun emptyNode( fun emptyNode(
buildContext: BuildContext, buildContext: BuildContext,
): Node = node(buildContext) { modifier -> ): Node = node(buildContext) { modifier ->
Box( EmptyView(modifier)
modifier = modifier }
.fillMaxSize()
.background(ElementTheme.colors.bgCanvasDefault), @Composable
) private fun EmptyView(modifier: Modifier) = Box(
modifier = modifier
.fillMaxSize()
.background(ElementTheme.colors.bgCanvasDefault),
)
@PreviewsDayNight
@Composable
internal fun EmptyViewPreview() = ElementPreview {
EmptyView(Modifier)
} }