Skip to content

Commit

Permalink
review: Remove padding from IllustratedMessageBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Oct 22, 2024
1 parent 31b8f27 commit b3308e9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fun IllustratedMessageBlock(
modifier: Modifier = Modifier,
) {
Column(
modifier = modifier.padding(horizontal = Margin.Medium),
modifier = modifier,
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
) {
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b3308e9

Please sign in to comment.