Skip to content

Commit ad0b5a7

Browse files
committed
Use list background content for empty list
1 parent 6cef2fb commit ad0b5a7

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

desktopApp/src/jvmMain/kotlin/com/prof18/feedflow/desktop/home/DesktopHomeScreenContent.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ fun DesktopHomeScreenContent(
8484
)
8585
}
8686
}
87-
val contentContainerColor = displayState.feedLayout.contentContainerColor()
87+
val contentContainerColor = displayState.feedLayout.contentContainerColor(
88+
hasFeedItems = displayState.feedItems.isNotEmpty(),
89+
)
8890

8991
Scaffold(
9092
modifier = modifier,
@@ -291,8 +293,8 @@ private fun FeedLayout.isCardStyleLayout() = when (this) {
291293
}
292294

293295
@Composable
294-
private fun FeedLayout.contentContainerColor(): Color =
295-
if (isCardStyleLayout()) {
296+
private fun FeedLayout.contentContainerColor(hasFeedItems: Boolean): Color =
297+
if (hasFeedItems && isCardStyleLayout()) {
296298
MaterialTheme.colorScheme.surfaceContainer
297299
} else {
298300
MaterialTheme.colorScheme.surface

sharedUI/src/commonMain/kotlin/com/prof18/feedflow/shared/ui/home/components/list/FeedListView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fun FeedList(
119119
feedItemDisplaySettings: FeedItemDisplaySettings = FeedItemDisplaySettings(),
120120
) {
121121
val itemFeedLayout = feedLayout.normalizeForFeedList()
122-
val feedBackgroundModifier = if (itemFeedLayout.usesCardBackground()) {
122+
val feedBackgroundModifier = if (itemFeedLayout.usesCardBackground() && feedItems.isNotEmpty()) {
123123
Modifier.background(MaterialTheme.colorScheme.surfaceContainer)
124124
} else {
125125
Modifier

0 commit comments

Comments
 (0)