polish: withdraw flow fixes (#4713)

* fix: negative value stuff

* fix: mobile responsiveness for modal min-w

* feat: better error handling on withdraw

* fix: empty state positioning + svg sizing

* fix: title case -> sentence case

* fix: re-add virtual visa under gift cards

* fix: hide <1% segments
This commit is contained in:
Calum H.
2025-11-04 21:29:47 +00:00
committed by GitHub
parent 6e47de06bb
commit f054f39c5d
9 changed files with 285 additions and 121 deletions

View File

@@ -449,12 +449,12 @@ export function createWithdrawContext(
const formCompleted = balance?.form_completion_status === 'complete'
if (formCompleted) {
return availableBalance
return Math.max(0, availableBalance)
}
const usedLimit = balance?.withdrawn_ytd ?? 0
const remainingLimit = Math.max(0, TAX_THRESHOLD_ACTUAL - usedLimit)
return Math.min(remainingLimit, availableBalance)
return Math.max(0, Math.min(remainingLimit, availableBalance))
})
const paymentOptions = computed<PaymentOption[]>(() => {
@@ -486,7 +486,10 @@ export function createWithdrawContext(
}
const merchantMethods = tremendousMethods.filter(
(m) => m.category === 'merchant_card' || m.category === 'merchant_cards',
(m) =>
m.category === 'merchant_card' ||
m.category === 'merchant_cards' ||
m.category === 'visa_card',
)
if (merchantMethods.length > 0) {
options.push({