diff options
| author | Sebastian <sebasjm@gmail.com> | 2022-05-04 16:25:53 -0300 |
|---|---|---|
| committer | Sebastian <sebasjm@gmail.com> | 2022-05-04 16:26:53 -0300 |
| commit | 7a2fe8018faa4666ff681072682f16f8fb1bfc13 (patch) | |
| tree | d82afd97a4748f64a794475db60df58b1baec776 /packages/taler-wallet-webextension/src/cta/Pay.tsx | |
| parent | 4491118494c332c9ce0a0c4533804744d63701f2 (diff) | |
add age restriction option to withdraw cta
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Pay.tsx')
| -rw-r--r-- | packages/taler-wallet-webextension/src/cta/Pay.tsx | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Pay.tsx b/packages/taler-wallet-webextension/src/cta/Pay.tsx index 0e2530149..4f44ebab2 100644 --- a/packages/taler-wallet-webextension/src/cta/Pay.tsx +++ b/packages/taler-wallet-webextension/src/cta/Pay.tsx @@ -542,23 +542,22 @@ function ButtonsSection({ ); } if (payStatus.status === PreparePayResultType.InsufficientBalance) { + let BalanceMessage = ""; + if (!state.balance) { + BalanceMessage = i18n.str`You have no balance for this currency. Withdraw digital cash first.`; + } else { + const balanceShouldBeEnough = + Amounts.cmp(state.balance, state.amount) !== -1; + if (balanceShouldBeEnough) { + BalanceMessage = i18n.str`Could not find enough coins to pay this order. Even if you have enough ${state.balance.currency} some restriction may apply.`; + } else { + BalanceMessage = i18n.str`Your current balance is not enough for this order.`; + } + } return ( <Fragment> <section> - {state.balance ? ( - <WarningBox> - <i18n.Translate> - Your balance of {<Amount value={state.balance} />} is not - enough to pay for this purchase - </i18n.Translate> - </WarningBox> - ) : ( - <WarningBox> - <i18n.Translate> - Your balance is not enough to pay for this purchase. - </i18n.Translate> - </WarningBox> - )} + <WarningBox>{BalanceMessage}</WarningBox> </section> <section> <ButtonSuccess |
