Reuse UnreadAtom composable

This commit is contained in:
Jenna Vassar
2026-05-28 09:06:01 -07:00
parent d653ceb84c
commit 40f8b48256
2 changed files with 15 additions and 20 deletions
@@ -8,7 +8,9 @@
package io.element.android.libraries.designsystem.atomic.atoms
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
@@ -32,6 +34,7 @@ fun UnreadIndicatorAtom(
color: Color = ElementTheme.colors.unreadIndicator,
isVisible: Boolean = true,
contentDescription: String? = null,
border: BorderStroke? = null,
) {
Box(
modifier = modifier
@@ -41,6 +44,7 @@ fun UnreadIndicatorAtom(
.size(size)
.clip(CircleShape)
.background(if (isVisible) color else Color.Transparent)
.then(if (border != null) Modifier.border(border, CircleShape) else Modifier)
)
}