From b3308e9966c7cb607dab3402469ddd8999a4aff8 Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Tue, 22 Oct 2024 10:26:27 +0200 Subject: [PATCH] review: Remove padding from IllustratedMessageBlock --- .../swisstransfer/ui/components/EmptyState.kt | 11 ++++++++++- .../ui/components/IllustratedMessageBlock.kt | 4 ++-- .../newtransfer/upload/UploadSuccessEmailScreen.kt | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) 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 3673e93cf..d3b517b5e 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 @@ -20,6 +20,7 @@ package com.infomaniak.swisstransfer.ui.components import android.content.res.Configuration import androidx.annotation.StringRes 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.Modifier @@ -28,6 +29,7 @@ import androidx.compose.ui.tooling.preview.Preview import com.infomaniak.swisstransfer.R import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus import com.infomaniak.swisstransfer.ui.images.illus.MascotSearching +import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme @Composable @@ -37,7 +39,14 @@ fun EmptyState( @StringRes description: Int, modifier: Modifier = Modifier, ) { - IllustratedMessageBlock(icon, title, description, modifier.fillMaxSize()) + IllustratedMessageBlock( + icon = icon, + title = title, + description = description, + modifier = modifier + .padding(horizontal = Margin.Medium) + .fillMaxSize(), + ) } @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 97878e8cd..0b32636ba 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 @@ -45,7 +45,7 @@ fun IllustratedMessageBlock( modifier: Modifier = Modifier, ) { Column( - modifier = modifier.padding(horizontal = Margin.Medium), + modifier = modifier, verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally, ) { @@ -74,7 +74,7 @@ fun IllustratedMessageBlock( @Preview(name = "Light mode") @Preview(name = "Dark mode", uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL) @Composable -private fun SwissTransferFabPreview() { +private fun IllustratedMessageBlockPreview() { SwissTransferTheme { Surface { IllustratedMessageBlock( diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessEmailScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessEmailScreen.kt index a59961956..77d88321a 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessEmailScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessEmailScreen.kt @@ -61,6 +61,7 @@ private fun Content() { icon = AppIllus.UploadSuccessEmail.image(), title = R.string.uploadSuccessEmailTitle, description = R.string.uploadSuccessEmailDescription, + modifier = Modifier.padding(horizontal = Margin.Medium), ) Spacer(Modifier.height(Margin.Small))