enhancement: shows only one date for edited contents (#456)

This commit is contained in:
Diego Beraldin 2024-01-17 09:16:51 +01:00 committed by GitHub
parent 086ec44c2f
commit 2b03b93f8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -107,7 +107,12 @@ fun PostCardFooter(
) )
} }
} }
if (publishDate != null) { listOf(
updateDate.orEmpty(),
publishDate.orEmpty(),
).firstOrNull {
it.isNotBlank()
}?.also { publishDate ->
Row( Row(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
@ -124,22 +129,13 @@ fun PostCardFooter(
) )
} }
} }
if (updateDate != null) { if (updateDate.orEmpty().isNotBlank()) {
Row( Icon(
verticalAlignment = Alignment.CenterVertically, modifier = buttonModifier,
) { imageVector = Icons.Default.Edit,
Icon( contentDescription = null,
modifier = buttonModifier, tint = ancillaryColor,
imageVector = Icons.Default.Edit, )
contentDescription = null,
tint = ancillaryColor,
)
Text(
text = updateDate.prettifyDate(),
style = MaterialTheme.typography.labelLarge,
color = ancillaryColor,
)
}
} }
if (options.isNotEmpty()) { if (options.isNotEmpty()) {
Icon( Icon(