aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/wallet/Transaction.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-04-14 14:16:08 -0300
committerSebastian <sebasjm@gmail.com>2023-04-14 14:16:25 -0300
commit6e060da237af35796b1b34dce108f05eef44ceb3 (patch)
tree6e21db09f1dd75f02821811ae165f056d2087be8 /packages/taler-wallet-webextension/src/wallet/Transaction.tsx
parent5ea22a325c069fe497b2dc8a73d4de69fd8cc27b (diff)
downloadwallet-core-6e060da237af35796b1b34dce108f05eef44ceb3.tar.xz
some changes
using transaction context from web utils alertContext.safely api change (easier to integrate) using lang and localstorage from web utils removing auto permission, from UI adding settings
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/Transaction.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/wallet/Transaction.tsx21
1 files changed, 7 insertions, 14 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx
index d34e57f58..1ef0f0b79 100644
--- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx
@@ -61,7 +61,7 @@ import {
import { Time } from "../components/Time.js";
import { alertFromError, useAlertContext } from "../context/alert.js";
import { useBackendContext } from "../context/backend.js";
-import { useTranslationContext } from "../context/translation.js";
+import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
import { useAsyncAsHook } from "../hooks/useAsyncAsHook.js";
import { Button } from "../mui/Button.js";
import { SafeHandler } from "../mui/handlers.js";
@@ -283,10 +283,7 @@ function TransactionTemplate({
<Button
variant="contained"
color="error"
- onClick={safely(
- onDelete,
- i18n.str`Could not forget transaction`,
- )}
+ onClick={safely("delete transaction", onDelete)}
>
<i18n.Translate>Confirm</i18n.Translate>
</Button>
@@ -322,10 +319,7 @@ function TransactionTemplate({
<Button
variant="contained"
color="error"
- onClick={safely(
- onCancel,
- i18n.str`Could not cancel the active transaction`,
- )}
+ onClick={safely("cancel active transaction", onCancel)}
>
<i18n.Translate>Yes</i18n.Translate>
</Button>
@@ -340,7 +334,7 @@ function TransactionTemplate({
{showSend ? (
<Button
variant="contained"
- onClick={safely(onSend, i18n.str`Could not send`)}
+ onClick={safely("send transaction", onSend)}
>
<i18n.Translate>Send</i18n.Translate>
</Button>
@@ -350,7 +344,7 @@ function TransactionTemplate({
{showRetry ? (
<Button
variant="contained"
- onClick={safely(onRetry, i18n.str`Could not retry`)}
+ onClick={safely("retry transaction", onRetry)}
>
<i18n.Translate>Retry</i18n.Translate>
</Button>
@@ -627,9 +621,8 @@ export function TransactionView({
<div>
<Button
variant="contained"
- onClick={safely(
- () => onRefund(transaction.proposalId),
- i18n.str`Could not refund`,
+ onClick={safely("refund transaction", () =>
+ onRefund(transaction.proposalId),
)}
>
<i18n.Translate>Accept</i18n.Translate>