Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💄 UI - Mega Menu hover effect improvements #100

Merged
merged 5 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/components/CountryDropdown/CountryDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ const CountryDropdown = ({ url }: CountryDropdownProps) => {
<Popover.Button
className={cx(
"flex items-center justify-center gap-x-1 rounded-md px-1 py-1 text-sm font-semibold text-ssw-black outline-none xs:px-4",
"hover:bg-gray-100",
isOpened && "bg-gray-100",
"hover:scale-105",
)}
onClick={() => setIsOpened(!isOpened)}
>
Expand All @@ -73,7 +72,7 @@ const CountryDropdown = ({ url }: CountryDropdownProps) => {
.map((country) => (
<CustomLink
key={country.country}
className="block min-w-[80px] py-2 hover:bg-gray-100"
className="block min-w-[80px] py-2 hover:scale-105"
href={country.url}
title={country.country}
>
Expand Down
4 changes: 2 additions & 2 deletions lib/components/DesktopMenu/DesktopMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const DesktopMenu: React.FC<DesktopMenuProps> = ({
return (
<>
<div className="hidden flex-1 xl:block">
<Popover.Group className="flex items-center justify-center text-sm font-semibold text-ssw-black outline-none">
<Popover.Group className="flex items-center justify-center gap-1 text-sm font-semibold text-ssw-black outline-none">
{menuGroups.map((group) => {
if (
!!group.menuColumns &&
Expand Down Expand Up @@ -76,7 +76,7 @@ const DesktopMenu: React.FC<DesktopMenuProps> = ({
</Popover.Group>
</div>

<div className="hidden shrink items-center justify-end xl:flex">
<div className="hidden shrink items-center justify-end gap-1 xl:flex">
{SideActions ? (
<SideActions />
) : (
Expand Down
2 changes: 1 addition & 1 deletion lib/components/DesktopMenu/MenuItemLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const MenuItemLink = ({ name, href }: MenuItemLinkProps) => {
return (
<CustomLink
href={href}
className="flex items-center justify-center rounded-md px-3 py-1"
className="flex items-center justify-center rounded-md px-3 py-1 hover:text-ssw-red"
>
{name}
</CustomLink>
Expand Down
9 changes: 3 additions & 6 deletions lib/components/DesktopMenu/MenuItemWithSubmenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ export const MenuItemWithSubmenu: React.FC<MenuItemWithSubmenuProps> = ({
<>
<Popover.Button
className={cx(
"flex cursor-pointer items-center justify-center gap-x-1 whitespace-nowrap rounded-md px-3 py-1 focus:outline-none focus-visible:ring-opacity-0",
isOpened ? "bg-gray-100" : "hover:bg-gray-100",
"flex cursor-pointer items-center justify-center gap-x-1 whitespace-nowrap rounded-md px-3 py-1 text-ssw-black focus:outline-none focus-visible:ring-opacity-0",
isOpened ? "text-ssw-red" : "hover:text-ssw-red",
)}
>
{name}
<MegaIcon
icon="chevronDown"
className="h-5 w-5 flex-none text-ssw-black"
/>
<MegaIcon icon="chevronDown" className="h-5 w-5 flex-none" />
</Popover.Button>

<Transition
Expand Down
2 changes: 1 addition & 1 deletion lib/components/MegaMenuLayout/MegaMenuLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const MegaMenuLayout: React.FC<MegaMenuWrapperProps> = ({
)}
>
<nav
className="flex h-full w-full items-center justify-between gap-x-1 overflow-hidden px-0 xs:gap-x-4"
className="flex h-full w-full items-center justify-between gap-x-1 overflow-hidden px-0 xs:gap-x-2"
aria-label="Global"
>
<div className="flex items-center">
Expand Down
4 changes: 2 additions & 2 deletions lib/components/MobileMenu/MobileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ const MenuBarItems: React.FC<MenuBarItemProps> = ({
<CustomLink
key={item.name}
href={item.url}
className="-mx-3 flex w-full items-center px-3 py-2 text-left text-lg leading-7 text-ssw-black hover:bg-gray-50"
className="-mx-3 flex w-full items-center px-3 py-2 text-left text-lg leading-7 text-ssw-black hover:text-ssw-red"
>
{item.name}
</CustomLink>
) : (
<button
key={item.name}
className="-mx-3 flex w-full items-center px-3 py-2 text-left text-lg leading-7 text-ssw-black hover:bg-gray-50"
className="-mx-3 flex w-full items-center px-3 py-2 text-left text-lg leading-7 text-ssw-black hover:text-ssw-red"
onClick={() => setSelectedMenuItem(item)}
>
{item.name}
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const Search: React.FC<SearchTermProps> = ({
return (
<>
<button
className="rounded p-4 text-ssw-black hover:bg-gray-100"
className="rounded p-4 text-ssw-black hover:text-ssw-red"
onClick={() => setIsOpen(true)}
>
<MegaIcon icon="magnifyingGlass" className="h-5 w-5" />
Expand Down
8 changes: 5 additions & 3 deletions lib/components/SubMenuGroup/SubMenuGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const LinkItem: React.FC<{ link: NavMenuColumnGroupItem }> = ({
<CustomLink
href={url || ""}
className={cx(
"flex items-start gap-x-3 rounded-md bg-white hover:bg-gray-100 focus:outline-none",
"flex items-start gap-x-3 rounded-md bg-white text-ssw-black hover:text-ssw-red focus:outline-none",
description ? "p-4" : "p-2",
)}
onClick={() => {
Expand All @@ -130,13 +130,15 @@ const LinkItem: React.FC<{ link: NavMenuColumnGroupItem }> = ({
<span>
{name && description ? (
<>
<p className="font-bold text-ssw-black">{name}</p>
<p className="font-bold">{name}</p>
<p className="mt-1 text-sm font-normal text-ssw-gray">
{description}
</p>
</>
) : (
<p className="pl-4 text-sm font-normal text-ssw-black">{name}</p>
<p className="pl-4 text-sm font-normal text-ssw-black hover:text-ssw-red">
{name}
</p>
)}
</span>
</div>
Expand Down
Loading
Loading