diff options
author | Sebastian <sebasjm@gmail.com> | 2022-03-21 11:20:43 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-03-21 11:20:43 -0300 |
commit | f7cabbf479c9703e4565ae610a68e652ba9e95b5 (patch) | |
tree | 63e6823a3e7cc4039b7d37a241cb2025c2a1f0a8 /packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx | |
parent | fac550d45494b8c00e833cdbfbc6e0714222cd4a (diff) | |
download | wallet-core-f7cabbf479c9703e4565ae610a68e652ba9e95b5.tar.xz |
fix: fixing navigation when trying to pay and there is no balance for that currency
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx b/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx index bf578dfb5..1996687ba 100644 --- a/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx +++ b/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx @@ -67,9 +67,9 @@ export function useComponentState( const initialExchange = foundExchangeForCurrency !== -1 ? exchangeSelectList[foundExchangeForCurrency] - : exchangeSelectList.length > 0 - ? exchangeSelectList[0] - : undefined; + : // : exchangeSelectList.length > 0 + // ? exchangeSelectList[0] + undefined; const [exchange, setExchange] = useState(initialExchange || ""); const [currency, setCurrency] = useState( @@ -137,6 +137,40 @@ export function CreateManualWithdraw({ const state = useComponentState(exchangeList, initialAmount, initialCurrency); if (!state.initialExchange) { + if (initialCurrency !== undefined) { + return ( + <section> + <h2> + <i18n.Translate> + Manual Withdrawal for {initialCurrency} + </i18n.Translate> + </h2> + <LightText> + <i18n.Translate> + Choose a exchange from where the coins will be withdrawn. The + exchange will send the coins to this wallet after receiving a wire + transfer with the correct subject. + </i18n.Translate> + </LightText> + <Centered style={{ marginTop: 100 }}> + <BoldLight> + <i18n.Translate> + No exchange found for {initialCurrency} + </i18n.Translate> + </BoldLight> + <LinkPrimary + href={Pages.settings_exchange_add.replace( + ":currency?", + initialCurrency, + )} + style={{ marginLeft: "auto" }} + > + <i18n.Translate>Add Exchange</i18n.Translate> + </LinkPrimary> + </Centered> + </section> + ); + } return ( <section> <h2> |