From 9e535a0a2317a7421f2a06cb5701ead965d4322b Mon Sep 17 00:00:00 2001 From: mul53 Date: Mon, 7 Sep 2026 14:13:10 +0200 Subject: [PATCH] fix(buy-crypto): title the amount screen "Buy USDC" and polish funding buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Amount screen header now reads "Buy USDC" rather than "Buy crypto". It is titled independently in two places — getBuyCryptoTitle for the embedded card-funding flow and useDepositOption for the global deposit modal — so both are updated, along with the test that asserts they stay aligned. - Drop the USD-equivalent line under the amount input. The field is already denominated in USDC, so "$3" under "3" only restated it; its Intl.NumberFormat computation goes with it. - Set the enabled "Continue to payment" label to text-black at the call site. The brand variant already forces black, but the label had previously come out white in some renders (see the note in button.tsx). - Read the local-currency chips on "Fund your wallet" from the static CARD_FUND_LOCAL_PAYMENT_METHODS map via getCardFundLocalPaymentMethods, matching what CardFundOptions already did. This drops three-to-four TransFi payment-config requests on open and renders the rails on first paint instead of once the responses land. - Round both payment hand-off buttons to a pill and make the secondary label white. button.tsx appends rounded-[30px] to brand buttons after the caller's className, so the green button was already a pill and the grey one was not. Co-Authored-By: Claude Opus 5 --- .../BuyCrypto/Transfi/TransfiAmount.tsx | 9 +++---- .../Transfi/TransfiPaymentHandoff.tsx | 8 +++--- .../DepositOption/DepositTypeSelection.tsx | 26 ++++--------------- hooks/useDepositOption.tsx | 2 +- lib/__tests__/buyCryptoFlow.test.ts | 2 +- lib/buyCryptoFlow.ts | 2 +- 6 files changed, 15 insertions(+), 34 deletions(-) diff --git a/components/BuyCrypto/Transfi/TransfiAmount.tsx b/components/BuyCrypto/Transfi/TransfiAmount.tsx index 4c298f9d..27715865 100644 --- a/components/BuyCrypto/Transfi/TransfiAmount.tsx +++ b/components/BuyCrypto/Transfi/TransfiAmount.tsx @@ -163,10 +163,6 @@ export const TransfiAmount = () => { !!activePaymentCode && !!currency; const continueDisabled = !isValid || creatingOrder; - const usdEquivalent = - Number.isFinite(amountNum) && amountNum > 0 - ? new Intl.NumberFormat(undefined, { maximumFractionDigits: 2 }).format(amountNum) - : '0'; // Reported once per amount that lands out of range, not per keystroke: the // limits being wrong for a market is the signal, not how fast someone types. @@ -258,7 +254,6 @@ export const TransfiAmount = () => { className="p-0 text-3xl font-semibold text-white web:outline-none" style={{ fontFamily: 'MonaSans_600SemiBold' }} /> - ${usdEquivalent} {/* Our own USDC mark, not TransFi's: theirs badges the delivery @@ -365,7 +360,9 @@ export const TransfiAmount = () => { disabled={continueDisabled} > {creatingOrder ? 'Creating order…' diff --git a/components/BuyCrypto/Transfi/TransfiPaymentHandoff.tsx b/components/BuyCrypto/Transfi/TransfiPaymentHandoff.tsx index c95e9300..ce14ddef 100644 --- a/components/BuyCrypto/Transfi/TransfiPaymentHandoff.tsx +++ b/components/BuyCrypto/Transfi/TransfiPaymentHandoff.tsx @@ -72,7 +72,7 @@ export const TransfiPaymentHandoff = ({