aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.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/paths/instance/products/list/index.tsx
parent382e66b179d6fda2598936196b2ae1b97bfab8ef (diff)
downloadwallet-core-c59f9a2556731ad95ab8bd7eefe7fa8a41629834.tar.xz
use translation context from web-utils, don't use match react-router since is broken
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx')
-rw-r--r--packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx
index 7e9118d24..41a07a7aa 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx
@@ -19,6 +19,7 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
+import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
import { h, VNode } from "preact";
import { useState } from "preact/hooks";
import { Loading } from "../../../../components/exception/loading.js";
@@ -29,7 +30,6 @@ import {
useInstanceProducts,
useProductAPI,
} from "../../../../hooks/product.js";
-import { useTranslator } from "../../../../i18n/index.js";
import { Notification } from "../../../../utils/types.js";
import { CardTable } from "./Table.js";
@@ -51,7 +51,7 @@ export default function ProductList({
const { deleteProduct, updateProduct } = useProductAPI();
const [notif, setNotif] = useState<Notification | undefined>(undefined);
- const i18n = useTranslator();
+ const { i18n } = useTranslationContext();
if (result.clientError && result.isUnauthorized) return onUnauthorized();
if (result.clientError && result.isNotfound) return onNotFound();
@@ -69,13 +69,13 @@ export default function ProductList({
updateProduct(id, prod)
.then(() =>
setNotif({
- message: i18n`product updated successfully`,
+ message: i18n.str`product updated successfully`,
type: "SUCCESS",
}),
)
.catch((error) =>
setNotif({
- message: i18n`could not update the product`,
+ message: i18n.str`could not update the product`,
type: "ERROR",
description: error.message,
}),
@@ -86,13 +86,13 @@ export default function ProductList({
deleteProduct(prod.id)
.then(() =>
setNotif({
- message: i18n`product delete successfully`,
+ message: i18n.str`product delete successfully`,
type: "SUCCESS",
}),
)
.catch((error) =>
setNotif({
- message: i18n`could not delete the product`,
+ message: i18n.str`could not delete the product`,
type: "ERROR",
description: error.message,
}),