From 06f9dec95b67155d6bd2f3e1b1e9004441831452 Mon Sep 17 00:00:00 2001 From: CaIon Date: Thu, 18 Jun 2026 14:39:48 +0800 Subject: [PATCH] feat(recharge): enhance payment method buttons with minimum top-up information --- .../wallet/components/recharge-form-card.tsx | 66 +++++++++++++++---- 1 file changed, 52 insertions(+), 14 deletions(-) diff --git a/web/default/src/features/wallet/components/recharge-form-card.tsx b/web/default/src/features/wallet/components/recharge-form-card.tsx index c1de6cff..817d211f 100644 --- a/web/default/src/features/wallet/components/recharge-form-card.tsx +++ b/web/default/src/features/wallet/components/recharge-form-card.tsx @@ -313,6 +313,14 @@ export function RechargeFormCard({ {topupInfo?.pay_methods?.map((method) => { const minTopup = method.min_topup || 0 const disabled = minTopup > topupAmount + const disabledReason = disabled + ? t('Minimum topup amount: {{amount}}', { + amount: minTopup, + }) + : undefined + const disabledLabel = disabled + ? `${t('Minimum:')} ${minTopup}` + : undefined const button = ( ) @@ -340,11 +363,7 @@ export function RechargeFormCard({ - - {t('Minimum topup amount: {{amount}}', { - amount: minTopup, - })} - + {disabledReason} ) : ( @@ -375,6 +394,14 @@ export function RechargeFormCard({ const loadingKey = `waffo-${index}` const waffoMin = waffoMinTopup || 0 const belowMin = waffoMin > topupAmount + const disabledReason = belowMin + ? t('Minimum topup amount: {{amount}}', { + amount: waffoMin, + }) + : undefined + const disabledLabel = belowMin + ? `${t('Minimum:')} ${waffoMin}` + : undefined const button = ( ) @@ -403,11 +445,7 @@ export function RechargeFormCard({ - - {t('Minimum topup amount: {{amount}}', { - amount: waffoMin, - })} - + {disabledReason} ) : (