aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx')
-rw-r--r--packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx21
1 files changed, 6 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 9819c1911..2090704d9 100644
--- a/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx
+++ b/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx
@@ -19,15 +19,12 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
-import {
- useMerchantApiContext,
- useTranslationContext,
-} from "@gnu-taler/web-util/browser";
+import { TalerError } from "@gnu-taler/taler-util";
+import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { Fragment, VNode, h } from "preact";
import { useSessionContext } from "../../context/session.js";
import { useInstanceKYCDetails } from "../../hooks/instance.js";
import { LangSelector } from "./LangSelector.js";
-import { TalerError } from "@gnu-taler/taler-util";
// const GIT_HASH = typeof __GIT_HASH__ !== "undefined" ? __GIT_HASH__ : undefined;
const VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : undefined;
@@ -38,6 +35,7 @@ interface Props {
export function Sidebar({ mobile }: Props): VNode {
const { i18n } = useTranslationContext();
+ const { state, logOut, config } = useSessionContext();
const kycStatus = useInstanceKYCDetails();
const needKYC =
@@ -45,11 +43,9 @@ export function Sidebar({ mobile }: Props): VNode {
!(kycStatus instanceof TalerError) &&
kycStatus.type === "ok" &&
!!kycStatus.body;
- const { state, logOut } = useSessionContext();
const isLoggedIn = state.status === "loggedIn";
const hasToken = isLoggedIn && state.token !== undefined;
- const { config, url: backendURL } = useMerchantApiContext();
-
+
return (
<aside
class="aside is-placed-left is-expanded"
@@ -195,10 +191,7 @@ export function Sidebar({ mobile }: Props): VNode {
</p>
<ul class="menu-list">
<li>
- <a
- class="has-icon is-state-info is-hoverable"
- href="/interface"
- >
+ <a class="has-icon is-state-info is-hoverable" href="/interface">
<span class="icon">
<i class="mdi mdi-newspaper" />
</span>
@@ -212,9 +205,7 @@ export function Sidebar({ mobile }: Props): VNode {
<span style={{ width: "3rem" }} class="icon">
<i class="mdi mdi-web" />
</span>
- <span class="menu-item-label">
- {backendURL.hostname}
- </span>
+ <span class="menu-item-label">{state.backendUrl.hostname}</span>
</div>
</li>
<li>