From 13748847560b31b104fd05a489fe65a5253855c7 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Sat, 22 Aug 2026 12:21:17 -0400 Subject: [PATCH] fix(tokens): lead the Get receipt with You Pay Swaps the Get receipt's two anchors so the amount charged sits above the fee breakdown and the amount received closes the card. The breakdown lines total to the top figure now, so they read as its itemisation. Gated on isGet: the v1 Buy receipt, and v2's Add Money, still lead with You Receive. --- .../app/tokens/internal/SwapReceiptScreen.kt | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/internal/SwapReceiptScreen.kt b/apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/internal/SwapReceiptScreen.kt index 623983a93..b8bc71617 100644 --- a/apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/internal/SwapReceiptScreen.kt +++ b/apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/internal/SwapReceiptScreen.kt @@ -69,7 +69,7 @@ internal data class ReceiptLine( * * The two flows are the same screen: a bordered card holding an anchor row, an optional block of * line items and a second anchor row, over a warning and a confirm button. They differ only in - * which side leads — Get reads "You Get / … / You Pay", Convert reads "You Convert / … / You + * which side leads — Get reads "You Pay / … / You Get", Convert reads "You Convert / … / You * Receive" — and in their copy, so all of that arrives as data. Each flow's own fee math stays in * the adapter that owns it, since that is the one piece the two genuinely disagree on. * @@ -278,14 +278,25 @@ private fun TokenBuyReceiptScreen( // reads "You Get / Amount to convert / Conversion fee" — the same wording Convert uses. val isGet = state.isGet - SwapReceiptScreen( - top = ReceiptAnchor( - title = stringResource( - if (isGet) R.string.subtitle_youGet else R.string.subtitle_youReceive - ), - token = state.tokenWithBalance?.token, - amount = purchaseAmount, + val received = ReceiptAnchor( + title = stringResource( + if (isGet) R.string.subtitle_youGet else R.string.subtitle_youReceive ), + token = state.tokenWithBalance?.token, + amount = purchaseAmount, + ) + + val paid = ReceiptAnchor( + title = stringResource(R.string.subtitle_youPay), + token = state.fundingTokenWithBalance?.token, + amount = totalPaid, + ) + + SwapReceiptScreen( + // Get leads with what it costs, so the fee lines underneath read as the breakdown of the + // figure directly above them. v1's Buy still leads with what you receive — its pixels are + // not this change's to move. + top = if (isGet) paid else received, lines = if (feeAmount.isPositive && purchaseAmount != null) { listOf( ReceiptLine( @@ -307,11 +318,7 @@ private fun TokenBuyReceiptScreen( // v1's fee lines sit a notch closer together. Gated, not unified: the Buy receipt still // renders for v1 and for v2's Add Money, and neither is this change's to restyle. lineSpacing = if (isGet) CodeTheme.dimens.grid.x3 else CodeTheme.dimens.grid.x2, - bottom = ReceiptAnchor( - title = stringResource(R.string.subtitle_youPay), - token = state.fundingTokenWithBalance?.token, - amount = totalPaid, - ), + bottom = if (isGet) received else paid, warning = stringResource(R.string.label_buyWarning), confirmLabel = stringResource( if (isGet) R.string.action_confirm else R.string.action_buy