mirror of
https://github.com/vercel/commerce.git
synced 2025-03-14 22:42:33 +00:00
UI Tweaks
This commit is contained in:
parent
52dbbb8ad8
commit
8e1c9f36f1
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -15,6 +15,10 @@
|
||||
@apply bg-accents-1;
|
||||
}
|
||||
|
||||
.link.active {
|
||||
@apply font-bold bg-accents-2;
|
||||
}
|
||||
|
||||
.off {
|
||||
@apply hidden;
|
||||
}
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user