diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/EmptyState.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/EmptyState.kt index 0d9728a21..085224308 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/EmptyState.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/EmptyState.kt @@ -19,10 +19,12 @@ package com.infomaniak.swisstransfer.ui.components import android.content.res.Configuration import androidx.annotation.StringRes +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.material3.Surface import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.tooling.preview.Preview @@ -39,14 +41,17 @@ fun EmptyState( @StringRes description: Int, modifier: Modifier = Modifier, ) { - IllustratedMessageBlock( - icon = icon, - title = title, - description = description, - modifier = modifier - .padding(horizontal = Margin.Medium) - .fillMaxSize(), - ) + Box( + modifier = Modifier.fillMaxSize(), + contentAlignment = Alignment.Center, + ) { + IllustratedMessageBlock( + icon = icon, + title = title, + description = description, + modifier = modifier.padding(horizontal = Margin.Medium), + ) + } } @Preview(name = "Light mode") diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/IllustratedMessageBlock.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/IllustratedMessageBlock.kt index 0b32636ba..464a543b4 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/IllustratedMessageBlock.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/IllustratedMessageBlock.kt @@ -20,7 +20,10 @@ package com.infomaniak.swisstransfer.ui.components import android.content.res.Configuration import androidx.annotation.StringRes import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.widthIn import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -46,7 +49,6 @@ fun IllustratedMessageBlock( ) { Column( modifier = modifier, - verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally, ) { Image(imageVector = icon, contentDescription = null)