import classNames from 'classnames'; import { NavLink, Link } from 'react-router-dom'; import { NetworkSwitcher, useEnvironment } from '@vegaprotocol/environment'; import { t } from '@vegaprotocol/react-helpers'; import { useGlobalStore } from '../../stores/global'; import { VegaWalletConnectButton } from '../vega-wallet-connect-button'; import { NewTab, ThemeSwitcher } from '@vegaprotocol/ui-toolkit'; import { Vega } from '../icons/vega'; import type { HTMLAttributeAnchorTarget } from 'react'; import { Routes } from '../../pages/client-router'; import { getNavLinkClassNames, getActiveNavLinkClassNames, Nav, } from '@vegaprotocol/ui-toolkit'; type NavbarTheme = 'inherit' | 'dark' | 'yellow'; interface NavbarProps { theme: 'light' | 'dark'; toggleTheme: () => void; navbarTheme?: NavbarTheme; } export const Navbar = ({ theme, toggleTheme, navbarTheme = 'inherit', }: NavbarProps) => { const { VEGA_TOKEN_URL } = useEnvironment(); const { marketId } = useGlobalStore((store) => ({ marketId: store.marketId, })); const tradingPath = marketId ? `/markets/${marketId}` : '/markets'; return ( ); }; interface AppNavLinkProps { name: string; path: string; navbarTheme: NavbarTheme; testId?: string; target?: HTMLAttributeAnchorTarget; } const AppNavLink = ({ name, path, navbarTheme, target, testId = name, }: AppNavLinkProps) => { const borderClasses = classNames('absolute h-1 w-full bottom-[-1px] left-0', { 'bg-black dark:bg-vega-yellow': navbarTheme !== 'yellow', 'bg-black': navbarTheme === 'yellow', }); return ( {({ isActive }) => { return ( <> {name} {isActive && } ); }} ); };