Skip to content

Commit c9b488c

Browse files
authored
Merge pull request #181 from code-payments/chore/badge-alignment-chat
chore(balance): align unread indicator with date label
2 parents bc8f886 + 52271d0 commit c9b488c

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

app/src/main/java/com/getcode/ui/components/Badge.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fun Badge(
3232
enterTransition: EnterTransition = scaleIn(tween(durationMillis = 300)) + fadeIn(),
3333
exitTransition: ExitTransition = fadeOut() + scaleOut(tween(durationMillis = 300))
3434
) {
35-
AnimatedVisibility(visible = count > 0, enter = enterTransition, exit = exitTransition) {
35+
AnimatedVisibility(modifier = modifier, visible = count > 0, enter = enterTransition, exit = exitTransition) {
3636
val text = when {
3737
count in 1..99 -> "$count"
3838
else -> "99+"
@@ -42,7 +42,7 @@ fun Badge(
4242
text = text,
4343
color = contentColor,
4444
style = CodeTheme.typography.body1.copy(fontWeight = FontWeight.W700),
45-
modifier = modifier
45+
modifier = Modifier
4646
.drawBehind {
4747
drawCircle(
4848
color = color,

app/src/main/java/com/getcode/ui/components/chat/ChatNode.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import com.getcode.theme.BrandLight
2626
import com.getcode.theme.CodeTheme
2727
import com.getcode.ui.components.Badge
2828
import com.getcode.ui.components.chat.utils.localizedText
29+
import com.getcode.ui.utils.debugBounds
2930
import com.getcode.util.DateUtils
3031
import java.util.Locale
3132

@@ -79,12 +80,14 @@ fun ChatNode(
7980
)
8081
if (chat.isMuted) {
8182
Icon(
82-
Icons.AutoMirrored.Filled.VolumeOff,
83+
imageVector = Icons.AutoMirrored.Filled.VolumeOff,
8384
contentDescription = "chat is muted",
8485
tint = BrandLight
8586
)
8687
} else {
8788
Badge(
89+
Modifier
90+
.padding(end = CodeTheme.dimens.grid.x1),
8891
count = chat.unreadCount,
8992
color = ChatNodeDefaults.UnreadIndicator
9093
)

0 commit comments

Comments
 (0)