diff options
author | Sebastian <sebasjm@gmail.com> | 2022-03-17 12:39:16 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-03-17 15:01:03 -0300 |
commit | b650750bccf40dfb12d0fc455cbebd8fa1fd5277 (patch) | |
tree | 74056e03424a977238e89ae4ad2228d791cf5430 /packages/taler-wallet-webextension/src/wallet | |
parent | 05838080f51f0405bde846703b28310a70e82b5f (diff) | |
download | wallet-core-b650750bccf40dfb12d0fc455cbebd8fa1fd5277.tar.xz |
no more back button
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet')
5 files changed, 32 insertions, 20 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx b/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx index 04ed5ec57..3516bfbf1 100644 --- a/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx +++ b/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx @@ -34,7 +34,7 @@ export function AddNewActionView({ onCancel }: Props): VNode { </section> <footer> <Button onClick={onCancel}> - <i18n.Translate>Back</i18n.Translate> + <i18n.Translate>Cancel</i18n.Translate> </Button> {uriType !== TalerUriType.Unknown && ( <ButtonSuccess diff --git a/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx b/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx index a5b5997b3..85541ab23 100644 --- a/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx @@ -26,6 +26,7 @@ import { useEffect, useState } from "preact/hooks"; import { Loading } from "../components/Loading"; import { SelectList } from "../components/SelectList"; import { + Button, ButtonBoxWarning, ButtonPrimary, ErrorText, @@ -39,9 +40,10 @@ import * as wxApi from "../wxApi"; interface Props { currency: string; + onCancel: (currency: string) => void; onSuccess: (currency: string) => void; } -export function DepositPage({ currency, onSuccess }: Props): VNode { +export function DepositPage({ currency, onCancel, onSuccess }: Props): VNode { const state = useAsyncAsHook(async () => { const balance = await wxApi.getBalance(); const bs = balance.balances.filter((b) => b.available.startsWith(currency)); @@ -79,6 +81,7 @@ export function DepositPage({ currency, onSuccess }: Props): VNode { return ( <View + onCancel={onCancel} knownBankAccounts={accounts} balance={currencyBalance} onSend={doSend} @@ -90,6 +93,7 @@ export function DepositPage({ currency, onSuccess }: Props): VNode { interface ViewProps { knownBankAccounts: Array<PaytoUri>; balance: AmountJson; + onCancel: (currency: string) => void; onSend: (account: string, amount: AmountString) => Promise<void>; onCalculateFee: ( account: string, @@ -98,6 +102,7 @@ interface ViewProps { } export function View({ + onCancel, knownBankAccounts, balance, onSend, @@ -142,16 +147,23 @@ export function View({ } if (!knownBankAccounts || !knownBankAccounts.length) { return ( - <WarningBox> - <p> - <i18n.Translate> - There is no known bank account to send money to - </i18n.Translate> - </p> - <ButtonBoxWarning> - <i18n.Translate>Withdraw</i18n.Translate> - </ButtonBoxWarning> - </WarningBox> + <Fragment> + <WarningBox> + <p> + <i18n.Translate> + There is no known bank account to send money to + </i18n.Translate> + </p> + <ButtonBoxWarning> + <i18n.Translate>Withdraw</i18n.Translate> + </ButtonBoxWarning> + </WarningBox> + <footer> + <Button onClick={() => onCancel(currency)}> + <i18n.Translate>Cancel</i18n.Translate> + </Button> + </footer> + </Fragment> ); } const parsedAmount = @@ -242,7 +254,9 @@ export function View({ } </section> <footer> - <div /> + <Button onClick={() => onCancel(currency)}> + <i18n.Translate>Cancel</i18n.Translate> + </Button> {unableToDeposit ? ( <ButtonPrimary disabled> <i18n.Translate>Deposit</i18n.Translate> diff --git a/packages/taler-wallet-webextension/src/wallet/ProviderAddPage.tsx b/packages/taler-wallet-webextension/src/wallet/ProviderAddPage.tsx index 051aff0b6..136521e6b 100644 --- a/packages/taler-wallet-webextension/src/wallet/ProviderAddPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/ProviderAddPage.tsx @@ -160,7 +160,7 @@ export function SetUrlView({ </section> <footer> <Button onClick={onCancel}> - < <i18n.Translate>Back</i18n.Translate> + <i18n.Translate>Cancel</i18n.Translate> </Button> <ButtonPrimary disabled={!value && !urlError} @@ -240,7 +240,7 @@ export function ConfirmProviderView({ </section> <footer> <Button onClick={onCancel}> - < <i18n.Translate>Back</i18n.Translate> + <i18n.Translate>Cancel</i18n.Translate> </Button> <ButtonPrimary disabled={!accepted} onClick={onConfirm}> <i18n.Translate>Add provider</i18n.Translate> diff --git a/packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx b/packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx index 066763ef5..765f34a02 100644 --- a/packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx @@ -115,7 +115,7 @@ export function ProviderView({ </section> <footer> <Button onClick={onBack}> - < <i18n.Translate>Back</i18n.Translate> + <i18n.Translate>See providers</i18n.Translate> </Button> <div /> </footer> @@ -209,7 +209,7 @@ export function ProviderView({ </section> <footer> <Button onClick={onBack}> - < <i18n.Translate>back</i18n.Translate> + <i18n.Translate>See providers</i18n.Translate> </Button> <div> <ButtonDestructive onClick={onDelete}> diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index fc54d3c3a..08cf8c7d1 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -162,9 +162,7 @@ export function TransactionView({ <div style={{ textAlign: "center" }}>{children}</div> </section> <footer> - <Button onClick={onBack}> - < <i18n.Translate> Back </i18n.Translate> - </Button> + <div /> <div> {showRetry ? ( <ButtonPrimary onClick={onRetry}> |