diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-10-06 16:33:05 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-10-06 16:33:05 +0200 |
commit | fe7b51ef2736edbf04f5bbd9d19f2a2d04baccc2 (patch) | |
tree | 66c68c8d6a666f6e74dc663c9ee4f07879f6626c /packages/merchant-backoffice-ui/src/components/menu | |
parent | 35611f0bf9cf67638b171c2a300fab1797d3d8f0 (diff) | |
parent | 97d7be7503168f4f3bbd05905d32aa76ca1636b2 (diff) |
Merge branch 'master' into age-withdraw
Diffstat (limited to 'packages/merchant-backoffice-ui/src/components/menu')
-rw-r--r-- | packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx | 29 | ||||
-rw-r--r-- | packages/merchant-backoffice-ui/src/components/menu/index.tsx | 8 |
2 files changed, 25 insertions, 12 deletions
diff --git a/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx b/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx index 3d5f20c85..402134096 100644 --- a/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx +++ b/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx @@ -49,7 +49,7 @@ export function Sidebar({ isPasswordOk }: Props): VNode { const config = useConfigContext(); - const { url: backendURL } = useBackendContext() + const { url: backendURL, resetBackend } = useBackendContext() const { i18n } = useTranslationContext(); const kycStatus = useInstanceKYCDetails(); const needKYC = kycStatus.ok && kycStatus.data.type === "redirect"; @@ -80,7 +80,7 @@ export function Sidebar({ </div> </div> <div class="menu is-menu-main"> - {isPasswordOk && instance ? ( + {instance ? ( <Fragment> <ul class="menu-list"> <li> @@ -94,12 +94,12 @@ export function Sidebar({ </a> </li> <li> - <a href={"/products"} class="has-icon"> + <a href={"/inventory"} class="has-icon"> <span class="icon"> <i class="mdi mdi-shopping" /> </span> <span class="menu-item-label"> - <i18n.Translate>Products</i18n.Translate> + <i18n.Translate>Inventory</i18n.Translate> </span> </a> </li> @@ -243,7 +243,7 @@ export function Sidebar({ </span> </div> </li> - {isPasswordOk && admin && !mimic && ( + {admin && !mimic && ( <Fragment> <p class="menu-label"> <i18n.Translate>Instances</i18n.Translate> @@ -270,7 +270,7 @@ export function Sidebar({ </li> </Fragment> )} - {isPasswordOk && + {isPasswordOk ? <li> <a class="has-icon is-state-info is-hoverable" @@ -283,8 +283,21 @@ export function Sidebar({ <i18n.Translate>Log out</i18n.Translate> </span> </a> - </li> - } + </li> : + <li> + <a + class="has-icon is-state-info is-hoverable" + onClick={(): void => resetBackend()} + > + <span class="icon"> + <i class="mdi mdi-logout default" /> + </span> + <span class="menu-item-label"> + <i18n.Translate>Change server</i18n.Translate> + </span> + </a> + </li> + } </ul> </div> </aside> diff --git a/packages/merchant-backoffice-ui/src/components/menu/index.tsx b/packages/merchant-backoffice-ui/src/components/menu/index.tsx index cb318906f..b8ac2c9ab 100644 --- a/packages/merchant-backoffice-ui/src/components/menu/index.tsx +++ b/packages/merchant-backoffice-ui/src/components/menu/index.tsx @@ -30,11 +30,11 @@ function getInstanceTitle(path: string, id: string): string { return `${id}: Orders`; case InstancePaths.order_new: return `${id}: New order`; - case InstancePaths.product_list: - return `${id}: Products`; - case InstancePaths.product_new: + case InstancePaths.inventory_list: + return `${id}: Inventory`; + case InstancePaths.inventory_new: return `${id}: New product`; - case InstancePaths.product_update: + case InstancePaths.inventory_update: return `${id}: Update product`; case InstancePaths.reserves_new: return `${id}: New reserve`; |