diff options
author | Sebastian <sebasjm@gmail.com> | 2022-12-20 17:45:24 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-12-20 17:45:24 -0300 |
commit | c59f9a2556731ad95ab8bd7eefe7fa8a41629834 (patch) | |
tree | 5cb60195d66cebbee0ba99e05eafe22f369a46a8 /packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx | |
parent | 382e66b179d6fda2598936196b2ae1b97bfab8ef (diff) | |
download | wallet-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/components/menu/SideBar.tsx')
-rw-r--r-- | packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx b/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx index ea49be99a..92d144b1a 100644 --- a/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx +++ b/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx @@ -19,13 +19,11 @@ * @author Sebastian Javier Marchano (sebasjm) */ +import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; import { Fragment, h, VNode } from "preact"; -import { useCallback } from "preact/hooks"; import { useBackendContext } from "../../context/backend.js"; import { useConfigContext } from "../../context/config.js"; -import { useInstanceContext } from "../../context/instance.js"; import { useInstanceKYCDetails } from "../../hooks/instance.js"; -import { Translate } from "../../i18n/index.js"; import { LangSelector } from "./LangSelector.js"; const GIT_HASH = typeof __GIT_HASH__ !== "undefined" ? __GIT_HASH__ : undefined; @@ -48,7 +46,7 @@ export function Sidebar({ }: Props): VNode { const config = useConfigContext(); const backend = useBackendContext(); - + const { i18n } = useTranslationContext(); const kycStatus = useInstanceKYCDetails(); const needKYC = kycStatus.ok && kycStatus.data.type === "redirect"; @@ -81,7 +79,7 @@ export function Sidebar({ {instance ? ( <Fragment> <p class="menu-label"> - <Translate>Instance</Translate> + <i18n.Translate>Instance</i18n.Translate> </p> <ul class="menu-list"> <li> @@ -90,7 +88,7 @@ export function Sidebar({ <i class="mdi mdi-square-edit-outline" /> </span> <span class="menu-item-label"> - <Translate>Settings</Translate> + <i18n.Translate>Settings</i18n.Translate> </span> </a> </li> @@ -100,7 +98,7 @@ export function Sidebar({ <i class="mdi mdi-cash-register" /> </span> <span class="menu-item-label"> - <Translate>Orders</Translate> + <i18n.Translate>Orders</i18n.Translate> </span> </a> </li> @@ -110,7 +108,7 @@ export function Sidebar({ <i class="mdi mdi-shopping" /> </span> <span class="menu-item-label"> - <Translate>Products</Translate> + <i18n.Translate>Products</i18n.Translate> </span> </a> </li> @@ -120,7 +118,7 @@ export function Sidebar({ <i class="mdi mdi-bank" /> </span> <span class="menu-item-label"> - <Translate>Transfers</Translate> + <i18n.Translate>Transfers</i18n.Translate> </span> </a> </li> @@ -130,7 +128,7 @@ export function Sidebar({ <i class="mdi mdi-newspaper" /> </span> <span class="menu-item-label"> - <Translate>Templates</Translate> + <i18n.Translate>Templates</i18n.Translate> </span> </a> </li> @@ -156,7 +154,7 @@ export function Sidebar({ </Fragment> ) : undefined} <p class="menu-label"> - <Translate>Connection</Translate> + <i18n.Translate>Connection</i18n.Translate> </p> <ul class="menu-list"> <li> @@ -190,7 +188,7 @@ export function Sidebar({ {admin && !mimic && ( <Fragment> <p class="menu-label"> - <Translate>Instances</Translate> + <i18n.Translate>Instances</i18n.Translate> </p> <li> <a href={"/instance/new"} class="has-icon"> @@ -198,7 +196,7 @@ export function Sidebar({ <i class="mdi mdi-plus" /> </span> <span class="menu-item-label"> - <Translate>New</Translate> + <i18n.Translate>New</i18n.Translate> </span> </a> </li> @@ -208,7 +206,7 @@ export function Sidebar({ <i class="mdi mdi-format-list-bulleted" /> </span> <span class="menu-item-label"> - <Translate>List</Translate> + <i18n.Translate>List</i18n.Translate> </span> </a> </li> @@ -223,7 +221,7 @@ export function Sidebar({ <i class="mdi mdi-logout default" /> </span> <span class="menu-item-label"> - <Translate>Log out</Translate> + <i18n.Translate>Log out</i18n.Translate> </span> </a> </li> |