add unread badge to users row

This commit is contained in:
Diogo
2024-08-30 14:34:03 +01:00
parent 4f9aabce7d
commit 27a80cb66c
2 changed files with 8 additions and 2 deletions
@@ -466,7 +466,7 @@ fun UserProfileButton(image: String?, allRead: Boolean, onButtonClicked: () -> U
@Composable
private fun BoxScope.unreadBadge(text: String? = "") {
fun BoxScope.unreadBadge(text: String? = "") {
Text(
text ?: "",
color = MaterialTheme.colors.onPrimary,
@@ -177,7 +177,13 @@ private fun UsersLayout(
onClick = { onUserClicked(u.user) },
enabled = !stopped
) {
ProfileImage(size = 44.dp * fontSizeSqrtMultiplier, image = u.user.image)
Box {
ProfileImage(size = 44.dp * fontSizeSqrtMultiplier, image = u.user.image)
if (u.unreadCount > 0) {
unreadBadge()
}
}
}
}
IconButton(