import React, { Fragment } from 'react'; import { Disclosure, Menu, Transition } from '@headlessui/react'; import { MenuIcon, XIcon } from '@heroicons/react/outline'; import { useAuth } from 'src/services/auth'; import Gravatar from 'react-gravatar'; import { Link, useLocation } from 'react-router-dom'; import clsx from 'clsx'; const navigation = [ { name: 'Dashboard', to: '/dashboard' }, { name: 'Users', to: '/users' }, ]; function classNames(...classes: any[]) { return classes.filter(Boolean).join(' '); } // eslint-disable-next-line @typescript-eslint/no-empty-interface interface HeaderProps {} const Header: React.FC = () => { const { logOut } = useAuth(); const { pathname } = useLocation(); return ( {({ open }) => (
{/* Mobile menu button */} Open main menu {open ? (
Stackspin Stackspin
{/* Current: "border-primary-500 text-gray-900", Default: "border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700" */} {navigation.map((item) => ( {item.name} ))}
{navigation.map((item) => ( { // // the object returned here is passed to the // // anchor element's props // return { // className: isCurrent // ? 'bg-primary-50 border-primary-400 text-primary-700 block pl-3 pr-4 py-2 border-l-4 text-base font-medium' // : 'border-transparent text-gray-500 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-700 block pl-3 pr-4 py-2 border-l-4 text-base font-medium', // 'aria-current': isCurrent ? 'page' : undefined, // }; // }} > {item.name} ))}
)}
); }; export default Header;