Add compact option in TimelineItem

This commit is contained in:
Shinokuni 2023-08-21 18:46:37 +02:00
parent 698abfe32b
commit 16ed0ef05e
1 changed files with 6 additions and 4 deletions

View File

@ -42,10 +42,12 @@ fun TimelineItem(
onClick: () -> Unit,
onFavorite: () -> Unit,
onReadLater: () -> Unit,
onShare: () -> Unit
onShare: () -> Unit,
modifier: Modifier = Modifier,
compactLayout: Boolean = false,
) {
Card(
modifier = Modifier
modifier = modifier
.padding(horizontal = MaterialTheme.spacing.shortSpacing)
.clickable { onClick() }
) {
@ -148,7 +150,7 @@ fun TimelineItem(
ShortSpacer()
if (itemWithFeed.item.cleanDescription != null) {
if (itemWithFeed.item.cleanDescription != null && !compactLayout) {
Text(
text = itemWithFeed.item.cleanDescription!!,
style = MaterialTheme.typography.bodyMedium,
@ -160,7 +162,7 @@ fun TimelineItem(
ShortSpacer()
}
if (itemWithFeed.item.imageLink != null) {
if (itemWithFeed.item.hasImage && !compactLayout) {
AsyncImage(
model = itemWithFeed.item.imageLink,
contentDescription = itemWithFeed.item.title!!,