From 71d550aba3b85369282d56e09d584a5ae3400e8b Mon Sep 17 00:00:00 2001 From: jijicodes Date: Mon, 11 Mar 2024 20:59:29 -0500 Subject: [PATCH] feat: added a analytics nav to the header --- components/Navbar/NavMenu.json | 5 +++++ components/Navbar/Navbar.tsx | 4 ++++ components/Navbar/NavbarPopper.tsx | 14 +++++++++----- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/components/Navbar/NavMenu.json b/components/Navbar/NavMenu.json index 934bcf01..5a213f68 100644 --- a/components/Navbar/NavMenu.json +++ b/components/Navbar/NavMenu.json @@ -32,5 +32,10 @@ "link": "/vaults" } ] + }, + { + "targetBlank": true, + "label": "Analytics", + "link": "https://info.whitewhale.money/pools" } ] diff --git a/components/Navbar/Navbar.tsx b/components/Navbar/Navbar.tsx index db15f8bd..d940b9ad 100644 --- a/components/Navbar/Navbar.tsx +++ b/components/Navbar/Navbar.tsx @@ -60,6 +60,10 @@ const Navbar = () => { label: 'Bridge', link: 'https://tfm.com/bridge', }, + { + label: 'Analytics', + link: 'https://info.whitewhale.money/pools', + }, ] return ( diff --git a/components/Navbar/NavbarPopper.tsx b/components/Navbar/NavbarPopper.tsx index 6f026e9c..c3168e0f 100644 --- a/components/Navbar/NavbarPopper.tsx +++ b/components/Navbar/NavbarPopper.tsx @@ -47,11 +47,15 @@ const NavbarPopper = ({ menu, currentChainName, chainId }) => { initialFocusRef={firstFieldRef} // Children defining sub menu items onOpen={ - menu.isExternal - ? openLink(`${menu.link}/?chainFrom=${chainId}&chainTo=${BRIDGE_NETWORK_DEFAULTS[chainId]}`) - : !menu?.children - ? () => push(`/${currentChainName}${menu.link}`) - : onOpen + // For a menu item that should open in a new tab + menu.targetBlank + ? openLink(menu.link) + // Specifically meant for linking to the TFM Bridge page + : menu.isExternal + ? openLink(`${menu.link}/?chainFrom=${chainId}&chainTo=${BRIDGE_NETWORK_DEFAULTS[chainId]}`) + : !menu?.children + ? () => push(`/${currentChainName}${menu.link}`) + : onOpen } onClose={onClose} >