summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/cta/Withdraw.tsx52
1 files changed, 34 insertions, 18 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
index 8f45a047c..7c9745ddc 100644
--- a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
@@ -18,7 +18,7 @@
* Page shown to the user to confirm creation
* of a reserve, usually requested by the bank.
*
- * @author Florian Dold
+ * @author sebasjm
*/
import {
@@ -26,6 +26,7 @@ import {
Amounts,
ExchangeListItem,
i18n,
+ Translate,
WithdrawUriInfoResponse,
} from "@gnu-taler/taler-util";
import { OperationFailedError } from "@gnu-taler/taler-wallet-core";
@@ -117,37 +118,48 @@ export function View({
return (
<WalletAction>
<LogoHeader />
- <h2>{i18n.str`Digital cash withdrawal`}</h2>
+ <h2>
+ <i18n.Translate>Digital cash withdrawal</i18n.Translate>
+ </h2>
{withdrawError && (
<ErrorTalerOperation
- title="Could not finish the withdrawal operation"
+ title={
+ <i18n.Translate>
+ Could not finish the withdrawal operation
+ </i18n.Translate>
+ }
error={withdrawError.operationError}
/>
)}
<section>
<Part
- title="Total to withdraw"
+ title={<i18n.Translate>Total to withdraw</i18n.Translate>}
text={amountToString(Amounts.sub(amount, withdrawalFee).amount)}
kind="positive"
/>
{Amounts.isNonZero(withdrawalFee) && (
<Fragment>
<Part
- title="Chosen amount"
+ title={<i18n.Translate>Chosen amount</i18n.Translate>}
text={amountToString(amount)}
kind="neutral"
/>
<Part
- title="Exchange fee"
+ title={<i18n.Translate>Exchange fee</i18n.Translate>}
text={amountToString(withdrawalFee)}
kind="negative"
/>
</Fragment>
)}
{exchangeBaseUrl && (
- <Part title="Exchange" text={exchangeBaseUrl} kind="neutral" big />
+ <Part
+ title={<i18n.Translate>Exchange</i18n.Translate>}
+ text={exchangeBaseUrl}
+ kind="neutral"
+ big
+ />
)}
</section>
{!reviewing && (
@@ -156,7 +168,7 @@ export function View({
<Fragment>
<div>
<SelectList
- label="Known exchanges"
+ label={<i18n.Translate>Known exchanges</i18n.Translate>}
list={exchanges}
value={nextExchange}
name="switchingExchange"
@@ -172,14 +184,16 @@ export function View({
setSwitchingExchange(false);
}}
>
- {nextExchange === undefined
- ? i18n.str`Cancel exchange selection`
- : i18n.str`Confirm exchange selection`}
+ {nextExchange === undefined ? (
+ <i18n.Translate>Cancel exchange selection</i18n.Translate>
+ ) : (
+ <i18n.Translate>Confirm exchange selection</i18n.Translate>
+ )}
</LinkSuccess>
</Fragment>
) : (
<LinkSuccess upperCased onClick={() => setSwitchingExchange(true)}>
- {i18n.str`Switch exchange`}
+ <i18n.Translate>Switch exchange</i18n.Translate>
</LinkSuccess>
)}
</section>
@@ -198,7 +212,7 @@ export function View({
disabled={!exchangeBaseUrl || confirmDisabled}
onClick={doWithdrawAndCheckError}
>
- {i18n.str`Confirm withdrawal`}
+ <i18n.Translate>Confirm withdrawal</i18n.Translate>
</ButtonSuccess>
)}
{terms.status === "notfound" && (
@@ -207,7 +221,7 @@ export function View({
disabled={!exchangeBaseUrl}
onClick={doWithdrawAndCheckError}
>
- {i18n.str`Withdraw anyway`}
+ <i18n.Translate>Withdraw anyway</i18n.Translate>
</ButtonWarning>
)}
</section>
@@ -270,7 +284,9 @@ export function WithdrawPageWithParsedURI({
if (detailsHook.hasError) {
return (
<LoadingError
- title="Could not load the withdrawal details"
+ title={
+ <i18n.Translate>Could not load the withdrawal details</i18n.Translate>
+ }
error={detailsHook}
/>
);
@@ -293,9 +309,7 @@ export function WithdrawPageWithParsedURI({
const onWithdraw = async (): Promise<void> => {
if (!exchange) return;
- console.log("accepting exchange", exchange);
const res = await wxApi.acceptWithdrawal(uri, exchange);
- console.log("accept withdrawal response", res);
if (res.confirmTransferUrl) {
document.location.href = res.confirmTransferUrl;
}
@@ -337,7 +351,9 @@ export function WithdrawPage({ talerWithdrawUri }: Props): VNode {
if (uriInfoHook.hasError) {
return (
<LoadingError
- title="Could not get the info from the URI"
+ title={
+ <i18n.Translate>Could not get the info from the URI</i18n.Translate>
+ }
error={uriInfoHook}
/>
);