From 25784dbe181a515a3c340f086fda347f77b86031 Mon Sep 17 00:00:00 2001 From: Boris Kovalskii <36034823+JustYay@users.noreply.github.com> Date: Wed, 10 Jun 2026 23:37:16 +1000 Subject: [PATCH] feat(balance): per-method quick amounts on top-up page --- src/pages/TopUpAmount.tsx | 6 +++++- src/types/index.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/TopUpAmount.tsx b/src/pages/TopUpAmount.tsx index 8d27106..1eefbbc 100644 --- a/src/pages/TopUpAmount.tsx +++ b/src/pages/TopUpAmount.tsx @@ -375,7 +375,11 @@ export default function TopUpAmount() { } }; - const quickAmounts = [100, 300, 500, 1000].filter((a) => a >= minRubles && a <= maxRubles); + const quickAmounts = ( + method.quick_amounts && method.quick_amounts.length > 0 + ? method.quick_amounts.map((kopeks) => kopeks / 100) + : [100, 300, 500, 1000] + ).filter((a) => a >= minRubles && a <= maxRubles); const currencyDecimals = targetCurrency === 'IRR' || targetCurrency === 'RUB' ? 0 : 2; const getQuickValue = (rub: number) => targetCurrency === 'IRR' diff --git a/src/types/index.ts b/src/types/index.ts index f2d8245..20cbbb8 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -448,6 +448,7 @@ export interface PaymentMethod { max_amount_kopeks: number; is_available: boolean; options?: PaymentMethodOption[] | null; + quick_amounts?: number[]; // Если true — после получения payment_url кабинет сразу делает // window.location.href вместо показа панели с кнопкой "Открыть". open_url_direct?: boolean;