From c2d2985e92791e875d4d5f1b89db5969827da446 Mon Sep 17 00:00:00 2001 From: Matthew Russell Date: Mon, 28 Nov 2022 18:02:24 -0600 Subject: [PATCH] chore: back merge release/testnet (#2248) * fix: orderbook decimal places issue (#2235) * fix: positions table fixes notional dp (#2144) * fix: update decimals on position notional size * fix: normalize values * fix: fix positions unit tests * fix: remove liquidation price * fix: positions linting issue * fix: remove liquidation price test * fix: remove total summary row * fix: remove comments * fix: cypress test to not show trailing 0s * fix: add back liq. price est as cell only * fix: remove not used params * chore: merge with release/testnet * fix: orderbook dp * Update libs/positions/src/lib/positions-table.spec.tsx * fix: governance navbar link (#2247) * fix: governance navbar link * fix(#2245): fix gov link a tag no navlink * fix(#2245): remove export getActiveNavLinkClassNames Co-authored-by: m.ray <16125548+MadalinaRaicu@users.noreply.github.com> --- apps/trading/components/navbar/navbar.tsx | 53 +++++++++++++++-------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/apps/trading/components/navbar/navbar.tsx b/apps/trading/components/navbar/navbar.tsx index ec3795682..950d2cbb7 100644 --- a/apps/trading/components/navbar/navbar.tsx +++ b/apps/trading/components/navbar/navbar.tsx @@ -67,13 +67,14 @@ export const Navbar = ({ path={Routes.PORTFOLIO} navbarTheme={navbarTheme} /> - + rel="noreferrer" + className={getActiveNavLinkClassNames(false, navbarTheme, true)} + > + {t('Governance')} +
@@ -108,19 +109,8 @@ const AppNavLink = ({ return ( { - return classNames('mx-2 py-3 self-end relative', { - 'cursor-default': isActive, - 'text-black dark:text-white': isActive && navbarTheme !== 'yellow', - 'text-neutral-500 dark:text-neutral-400 hover:text-black dark:hover:text-neutral-300': - !isActive && navbarTheme !== 'yellow', - 'ml-auto': alignRight, - 'text-black': isActive && navbarTheme === 'yellow', - 'text-black/60 hover:text-black': - !isActive && navbarTheme === 'yellow', - }); - }} + to={{ pathname: path }} + className={getNavLinkClassNames(navbarTheme, alignRight)} target={target} > {({ isActive }) => { @@ -134,3 +124,28 @@ const AppNavLink = ({ ); }; + +function getNavLinkClassNames( + navbarTheme: string, + alignRight = false +): (props: { isActive?: boolean }) => string | undefined { + return ({ isActive = false }) => { + return getActiveNavLinkClassNames(isActive, navbarTheme, alignRight); + }; +} + +const getActiveNavLinkClassNames = ( + isActive: boolean, + navbarTheme: string, + alignRight = false +): string | undefined => { + return classNames('mx-2 py-3 self-end relative', { + 'cursor-default': isActive, + 'text-black dark:text-white': isActive && navbarTheme !== 'yellow', + 'text-neutral-500 dark:text-neutral-400 hover:text-black dark:hover:text-neutral-300': + !isActive && navbarTheme !== 'yellow', + 'ml-auto': alignRight, + 'text-black': isActive && navbarTheme === 'yellow', + 'text-black/60 hover:text-black': !isActive && navbarTheme === 'yellow', + }); +};