import { CloseIcon } from '@chakra-ui/icons'; import type { FlexProps, IconProps } from '@chakra-ui/react'; import { Box, chakra, Divider, Flex, Icon, Menu, MenuButton, MenuItem, MenuList, useColorModeValue, } from '@chakra-ui/react'; import { useRouter } from 'next/router'; import React, { forwardRef } from 'react'; import { AiOutlineGithub } from 'react-icons/ai'; import { RiMenu3Line } from 'react-icons/ri'; import { ColorMode } from '../ColorMode'; import { Link } from '../Link'; import { Logo } from '../Logo'; import { MAX_CONTENT_WIDTH, TOP_NAVBAR_HEIGHT } from './constants'; const RiMenu3Line_ = chakra(RiMenu3Line); const MenuLineIcon = forwardRef(function Icon( props, ref, ) { return ( ); }); const links = [ { href: '/docs/getting-started', label: 'Docs' }, { href: '/wallets/metamask', label: 'Wallets' }, { href: '/plugins/balance', label: 'Plugins' }, ]; export const TopNavbar = ({ ...props }: FlexProps) => { const bg = useColorModeValue('white', 'gray.800'); const router = useRouter(); const asPath = router.asPath; return ( {links.map(({ label, href }) => { const isActive = asPath.startsWith(href); return ( {label} ); })} {/** Github */} {/** site mobile menu */} {({ isOpen }) => ( <> {links.map(({ label, href }, idx) => { const isActive = asPath.startsWith(href); return ( {idx !== 0 && } {label} ); })} )} ); };