diff options
author | Sebastian <sebasjm@gmail.com> | 2023-09-04 14:17:55 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-09-04 14:17:55 -0300 |
commit | e1d86816a7c07cb8ca2d54676d5cdbbe513f2ba7 (patch) | |
tree | d4ed5506ab3550a7e9b1a082d7ffeddf9f3c4954 /packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx | |
parent | ff20c3e25e076c24f7cb93eabe58b6f934f51f35 (diff) | |
download | wallet-core-e1d86816a7c07cb8ca2d54676d5cdbbe513f2ba7.tar.xz |
backoffcie new version, lot of changes
Diffstat (limited to 'packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx')
-rw-r--r-- | packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx | 81 |
1 files changed, 58 insertions, 23 deletions
diff --git a/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx b/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx index f3cf80b92..be2f8dde5 100644 --- a/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx +++ b/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx @@ -25,6 +25,7 @@ import { useBackendContext } from "../../context/backend.js"; import { useConfigContext } from "../../context/config.js"; import { useInstanceKYCDetails } from "../../hooks/instance.js"; import { LangSelector } from "./LangSelector.js"; +import { useCredentialsChecker } from "../../hooks/backend.js"; const GIT_HASH = typeof __GIT_HASH__ !== "undefined" ? __GIT_HASH__ : undefined; const VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : undefined; @@ -36,6 +37,7 @@ interface Props { instance: string; admin?: boolean; mimic?: boolean; + isPasswordOk: boolean; } export function Sidebar({ @@ -45,6 +47,7 @@ export function Sidebar({ onLogout, admin, mimic, + isPasswordOk }: Props): VNode { const config = useConfigContext(); const backend = useBackendContext(); @@ -53,7 +56,7 @@ export function Sidebar({ const needKYC = kycStatus.ok && kycStatus.data.type === "redirect"; return ( - <aside class="aside is-placed-left is-expanded"> + <aside class="aside is-placed-left is-expanded" style={{ overflowY: "scroll" }}> {mobile && ( <div class="footer" @@ -78,10 +81,10 @@ export function Sidebar({ </div> </div> <div class="menu is-menu-main"> - {instance ? ( + {isPasswordOk && instance ? ( <Fragment> <ul class="menu-list"> - <li> + <li> <a href={"/orders"} class="has-icon"> <span class="icon"> <i class="mdi mdi-cash-register" /> @@ -104,7 +107,7 @@ export function Sidebar({ <li> <a href={"/transfers"} class="has-icon"> <span class="icon"> - <i class="mdi mdi-bank" /> + <i class="mdi mdi-arrow-left-right" /> </span> <span class="menu-item-label"> <i18n.Translate>Transfers</i18n.Translate> @@ -137,12 +140,22 @@ export function Sidebar({ </p> <ul class="menu-list"> <li> - <a href={"/update"} class="has-icon"> + <a href={"/bank"} class="has-icon"> <span class="icon"> - <i class="mdi mdi-square-edit-outline" /> + <i class="mdi mdi-bank" /> + </span> + <span class="menu-item-label"> + <i18n.Translate>Bank account</i18n.Translate> + </span> + </a> + </li> + <li> + <a href={"/validators"} class="has-icon"> + <span class="icon"> + <i class="mdi mdi-lock" /> </span> <span class="menu-item-label"> - <i18n.Translate>Account</i18n.Translate> + <i18n.Translate>Validators</i18n.Translate> </span> </a> </li> @@ -164,6 +177,26 @@ export function Sidebar({ </span> </a> </li> + <li> + <a href={"/server"} class="has-icon"> + <span class="icon"> + <i class="mdi mdi-square-edit-outline" /> + </span> + <span class="menu-item-label"> + <i18n.Translate>Server</i18n.Translate> + </span> + </a> + </li> + <li> + <a href={"/token"} class="has-icon"> + <span class="icon"> + <i class="mdi mdi-security" /> + </span> + <span class="menu-item-label"> + <i18n.Translate>Access token</i18n.Translate> + </span> + </a> + </li> </ul> </Fragment> ) : undefined} @@ -174,12 +207,12 @@ export function Sidebar({ <li> <a class="has-icon is-state-info is-hoverable" onClick={(): void => onShowSettings()} - > + > <span class="icon"> <i class="mdi mdi-newspaper" /> </span> <span class="menu-item-label"> - <i18n.Translate>Settings</i18n.Translate> + <i18n.Translate>Interface</i18n.Translate> </span> </a> </li> @@ -211,7 +244,7 @@ export function Sidebar({ </span> </div> </li> - {admin && !mimic && ( + {isPasswordOk && admin && !mimic && ( <Fragment> <p class="menu-label"> <i18n.Translate>Instances</i18n.Translate> @@ -238,19 +271,21 @@ export function Sidebar({ </li> </Fragment> )} - <li> - <a - class="has-icon is-state-info is-hoverable" - onClick={(): void => onLogout()} - > - <span class="icon"> - <i class="mdi mdi-logout default" /> - </span> - <span class="menu-item-label"> - <i18n.Translate>Log out</i18n.Translate> - </span> - </a> - </li> + {isPasswordOk && + <li> + <a + class="has-icon is-state-info is-hoverable" + onClick={(): void => onLogout()} + > + <span class="icon"> + <i class="mdi mdi-logout default" /> + </span> + <span class="menu-item-label"> + <i18n.Translate>Log out</i18n.Translate> + </span> + </a> + </li> + } </ul> </div> </aside> |