From df3fd5ddf0db8aed0e900d319c0e00f6ff8ddd14 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Tue, 8 Sep 2026 19:53:47 -0400 Subject: [PATCH] fix(txn-details): drop the token badge from the header avatar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The details header drew the mint as a coin over the avatar's bottom-right corner, the same badge the activity row uses. On this screen it is redundant: the line under the amount already names the token ("Aug 29 • Jeffy"), so the badge repeats it. Figma 9708:117414 draws the header avatar bare — an 80x80 circle with no coin. The row keeps the badge, where it is the only thing naming the token; without it every tip reads the same whether it was dollars or a creator coin. TransactionAvatarImage is shared between the two, so this adds showBadge rather than changing the model. The slot collapses to the avatar's own size when the badge is off, since there is then nothing to overhang — which also drops the 10dp of dead space the header was carrying above the name. --- .../transactionhistory/TransactionAvatarImage.kt | 12 +++++++++--- .../transactionhistory/TransactionDetailsContent.kt | 3 +-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/flipcash/shared/transaction-history/src/main/kotlin/com/flipcash/shared/transactionhistory/TransactionAvatarImage.kt b/apps/flipcash/shared/transaction-history/src/main/kotlin/com/flipcash/shared/transactionhistory/TransactionAvatarImage.kt index e98f1c9d62..5e08c5346b 100644 --- a/apps/flipcash/shared/transaction-history/src/main/kotlin/com/flipcash/shared/transactionhistory/TransactionAvatarImage.kt +++ b/apps/flipcash/shared/transaction-history/src/main/kotlin/com/flipcash/shared/transactionhistory/TransactionAvatarImage.kt @@ -26,7 +26,12 @@ private const val SwapCoinRatio = 0.625f /** * A [TransactionAvatar] drawn as an image: the avatar centred in a box wide enough for the token * badge to overhang its bottom-right corner without pushing whatever sits beside it (Figma - * 9717:14138). Every caller reserves the full slot, badge or not, so a list of them lines up. + * 9717:14138). Every badged caller reserves the full slot, carrying one or not, so a list of them + * lines up. + * + * [showBadge] turns the badge off for a caller that already names the token in its own right — see + * the details screen's header (Figma 9708:117414), where it would only repeat the line under the + * amount. The slot collapses to [size] with it, since there is then nothing to overhang. * * Shared between the activity row and the details screen it opens, at different sizes, so the * screen opens on exactly the avatar that was tapped rather than a second rendering of it. @@ -47,10 +52,11 @@ fun TransactionAvatarImage( size: Dp = CodeTheme.dimens.staticGrid.x8, slotSize: Dp = CodeTheme.dimens.staticGrid.x10, badgeSize: Dp = CodeTheme.dimens.staticGrid.x4, + showBadge: Boolean = true, iconOverride: @Composable ((Any?) -> Any?) = { it }, ) { Box( - modifier = modifier.requiredSize(slotSize), + modifier = modifier.requiredSize(if (showBadge) slotSize else size), contentAlignment = Alignment.Center, ) { val avatarModifier = Modifier @@ -85,7 +91,7 @@ fun TransactionAvatarImage( // Ringed in the page background so the coin reads as sitting over the avatar rather than // being part of it — the same treatment [SwapAvatar] gives its overlapping pair. - avatar.badgeToken?.let { token -> + avatar.badgeToken?.takeIf { showBadge }?.let { token -> TokenIcon( token = token, iconOverride = iconOverride, diff --git a/apps/flipcash/shared/transaction-history/src/main/kotlin/com/flipcash/shared/transactionhistory/TransactionDetailsContent.kt b/apps/flipcash/shared/transaction-history/src/main/kotlin/com/flipcash/shared/transactionhistory/TransactionDetailsContent.kt index 9afafdbbbd..1db42556fa 100644 --- a/apps/flipcash/shared/transaction-history/src/main/kotlin/com/flipcash/shared/transactionhistory/TransactionDetailsContent.kt +++ b/apps/flipcash/shared/transaction-history/src/main/kotlin/com/flipcash/shared/transactionhistory/TransactionDetailsContent.kt @@ -144,8 +144,7 @@ private fun Header( TransactionAvatarImage( avatar = details.avatar, size = CodeTheme.dimens.staticGrid.x16, - slotSize = CodeTheme.dimens.staticGrid.x18, - badgeSize = CodeTheme.dimens.staticGrid.x6, + showBadge = false, iconOverride = iconOverride, )