4
0
forked from crowetic/commerce

UI Tweaks

This commit is contained in:
Belen Curcio 2020-10-26 13:20:56 -03:00
parent 52dbbb8ad8
commit 8e1c9f36f1
4 changed files with 28 additions and 5 deletions

View File

@ -9,3 +9,12 @@
.link:focus {
@apply outline-none text-accents-8;
}
.logo {
@apply cursor-pointer rounded-full border transform duration-100 ease-in-out;
&:hover {
@apply shadow-md;
transform: scale(1.05);
}
}

View File

@ -15,7 +15,7 @@ const Navbar: FC<Props> = ({ className }) => {
<div className="flex justify-between align-center flex-row py-4 md:py-6 relative">
<div className="flex flex-1 items-center">
<Link href="/">
<a className="cursor-pointer" aria-label="Logo">
<a className={s.logo} aria-label="Logo">
<Logo />
</a>
</Link>

View File

@ -15,6 +15,10 @@
@apply bg-accents-1;
}
.link.active {
@apply font-bold bg-accents-2;
}
.off {
@apply hidden;
}

View File

@ -6,6 +6,8 @@ import s from './DropdownMenu.module.css'
import { Moon, Sun } from '@components/icons'
import { Menu, Transition } from '@headlessui/react'
import useLogout from '@lib/bigcommerce/use-logout'
import { useRouter } from 'next/router'
interface DropdownMenuProps {
open: boolean
}
@ -20,7 +22,7 @@ const LINKS = [
href: '/profile',
},
{
name: 'Cart',
name: 'My Cart',
href: '/cart',
},
]
@ -28,6 +30,8 @@ const LINKS = [
const DropdownMenu: FC<DropdownMenuProps> = ({ open = false }) => {
const { theme, setTheme } = useTheme()
const logout = useLogout()
const { pathname } = useRouter()
return (
<Transition
show={open}
@ -41,11 +45,17 @@ const DropdownMenu: FC<DropdownMenuProps> = ({ open = false }) => {
<Menu.Items className={s.dropdownMenu}>
{LINKS.map(({ name, href }) => (
<Menu.Item key={href}>
{({ active }) => (
<div>
<Link href={href}>
<a className={cn(s.link, { [s.active]: active })}>{name}</a>
<a
className={cn(s.link, {
[s.active]: pathname === href,
})}
>
{name}
</a>
</Link>
)}
</div>
</Menu.Item>
))}
<Menu.Item>