Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/main/java/com/getcode/ui/components/Badge.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fun Badge(
enterTransition: EnterTransition = scaleIn(tween(durationMillis = 300)) + fadeIn(),
exitTransition: ExitTransition = fadeOut() + scaleOut(tween(durationMillis = 300))
) {
AnimatedVisibility(visible = count > 0, enter = enterTransition, exit = exitTransition) {
AnimatedVisibility(modifier = modifier, visible = count > 0, enter = enterTransition, exit = exitTransition) {
val text = when {
count in 1..99 -> "$count"
else -> "99+"
Expand All @@ -42,7 +42,7 @@ fun Badge(
text = text,
color = contentColor,
style = CodeTheme.typography.body1.copy(fontWeight = FontWeight.W700),
modifier = modifier
modifier = Modifier
.drawBehind {
drawCircle(
color = color,
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/com/getcode/ui/components/chat/ChatNode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.getcode.theme.BrandLight
import com.getcode.theme.CodeTheme
import com.getcode.ui.components.Badge
import com.getcode.ui.components.chat.utils.localizedText
import com.getcode.ui.utils.debugBounds
import com.getcode.util.DateUtils
import java.util.Locale

Expand Down Expand Up @@ -79,12 +80,14 @@ fun ChatNode(
)
if (chat.isMuted) {
Icon(
Icons.AutoMirrored.Filled.VolumeOff,
imageVector = Icons.AutoMirrored.Filled.VolumeOff,
contentDescription = "chat is muted",
tint = BrandLight
)
} else {
Badge(
Modifier
.padding(end = CodeTheme.dimens.grid.x1),
count = chat.unreadCount,
color = ChatNodeDefaults.UnreadIndicator
)
Expand Down