Skip to content

Commit

Permalink
review: Move vertical arrangement from IllustratedMessageBlock to Emp…
Browse files Browse the repository at this point in the history
…tyState
  • Loading branch information
KevinBoulongne committed Oct 22, 2024
1 parent c9f7f0d commit 90b1e4a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,7 +49,6 @@ fun IllustratedMessageBlock(
) {
Column(
modifier = modifier,
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
) {
Image(imageVector = icon, contentDescription = null)
Expand Down

0 comments on commit 90b1e4a

Please sign in to comment.