aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/components/exception/AsyncButton.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-12-20 17:45:24 -0300
committerSebastian <sebasjm@gmail.com>2022-12-20 17:45:24 -0300
commitc59f9a2556731ad95ab8bd7eefe7fa8a41629834 (patch)
tree5cb60195d66cebbee0ba99e05eafe22f369a46a8 /packages/merchant-backoffice-ui/src/components/exception/AsyncButton.tsx
parent382e66b179d6fda2598936196b2ae1b97bfab8ef (diff)
downloadwallet-core-c59f9a2556731ad95ab8bd7eefe7fa8a41629834.tar.gz
wallet-core-c59f9a2556731ad95ab8bd7eefe7fa8a41629834.tar.bz2
wallet-core-c59f9a2556731ad95ab8bd7eefe7fa8a41629834.zip
use translation context from web-utils, don't use match react-router since is broken
Diffstat (limited to 'packages/merchant-backoffice-ui/src/components/exception/AsyncButton.tsx')
-rw-r--r--packages/merchant-backoffice-ui/src/components/exception/AsyncButton.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/merchant-backoffice-ui/src/components/exception/AsyncButton.tsx b/packages/merchant-backoffice-ui/src/components/exception/AsyncButton.tsx
index 510bc29b8..aa50dfa91 100644
--- a/packages/merchant-backoffice-ui/src/components/exception/AsyncButton.tsx
+++ b/packages/merchant-backoffice-ui/src/components/exception/AsyncButton.tsx
@@ -22,7 +22,7 @@
import { ComponentChildren, h } from "preact";
import { LoadingModal } from "../modal/index.js";
import { useAsync } from "../../hooks/async.js";
-import { Translate } from "../../i18n/index.js";
+import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
type Props = {
children: ComponentChildren;
@@ -33,14 +33,14 @@ type Props = {
export function AsyncButton({ onClick, disabled, children, ...rest }: Props) {
const { isSlow, isLoading, request, cancel } = useAsync(onClick);
-
+ const { i18n } = useTranslationContext();
if (isSlow) {
return <LoadingModal onCancel={cancel} />;
}
if (isLoading) {
return (
<button class="button">
- <Translate>Loading...</Translate>
+ <i18n.Translate>Loading...</i18n.Translate>
</button>
);
}