import classNames from 'classnames'; import { useRouter } from 'next/router'; import Link from 'next/link'; import { NetworkSwitcher } from '@vegaprotocol/environment'; import { t } from '@vegaprotocol/react-helpers'; import { useGlobalStore } from '../../stores/global'; import { VegaWalletConnectButton } from '../vega-wallet-connect-button'; import { ThemeSwitcher } from '@vegaprotocol/ui-toolkit'; import { Vega } from '../icons/vega'; interface NavbarProps { theme: 'light' | 'dark'; toggleTheme: () => void; } export const Navbar = ({ theme, toggleTheme }: NavbarProps) => { const { marketId, update } = useGlobalStore((store) => ({ marketId: store.marketId, update: store.update, })); const tradingPath = marketId ? `/markets/${marketId}` : '/markets'; return (
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
update({ connectDialog: open })} />
); }; interface NavLinkProps { name: string; path: string; exact?: boolean; testId?: string; } const NavLink = ({ name, path, exact, testId = name }: NavLinkProps) => { const router = useRouter(); const isActive = router.asPath === path || (!exact && router.asPath.startsWith(path)); const linkClasses = classNames('mx-2 py-2 self-end border-b-4', { 'border-vega-yellow text-white cursor-default': isActive, 'border-transparent text-neutral-400 hover:text-neutral-300': !isActive, }); return ( {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} {name} ); };