From 25c91dc590b8637647f69217b1e15e29e67a1e7a Mon Sep 17 00:00:00 2001 From: Stephanie Dietz <49788645+StephDietz@users.noreply.github.com> Date: Mon, 10 Jul 2023 15:26:42 -0500 Subject: [PATCH] Replace Icons with heroicons (#1066) * replace icons with heroicons * prettier * update chevron direction --- components/cart/delete-item-button.tsx | 4 ++-- components/cart/edit-item-quantity-button.tsx | 3 +-- components/icons/arrow-left.tsx | 14 -------------- components/icons/caret-right.tsx | 17 ----------------- components/icons/cart.tsx | 5 ++--- components/icons/close.tsx | 17 ----------------- components/icons/menu.tsx | 16 ---------------- components/icons/minus.tsx | 16 ---------------- components/icons/plus.tsx | 17 ----------------- components/icons/search.tsx | 11 ----------- components/layout/navbar/mobile-menu.tsx | 7 +++---- components/layout/navbar/search.tsx | 4 ++-- components/layout/search/filter/dropdown.tsx | 4 ++-- components/product/gallery.tsx | 6 +++--- 14 files changed, 15 insertions(+), 126 deletions(-) delete mode 100644 components/icons/arrow-left.tsx delete mode 100644 components/icons/caret-right.tsx delete mode 100644 components/icons/close.tsx delete mode 100644 components/icons/menu.tsx delete mode 100644 components/icons/minus.tsx delete mode 100644 components/icons/plus.tsx delete mode 100644 components/icons/search.tsx diff --git a/components/cart/delete-item-button.tsx b/components/cart/delete-item-button.tsx index 05cce6ff3..5c0419358 100644 --- a/components/cart/delete-item-button.tsx +++ b/components/cart/delete-item-button.tsx @@ -1,4 +1,4 @@ -import CloseIcon from 'components/icons/close'; +import { XMarkIcon } from '@heroicons/react/24/outline'; import LoadingDots from 'components/loading-dots'; import { useRouter } from 'next/navigation'; @@ -37,7 +37,7 @@ export default function DeleteItemButton({ item }: { item: CartItem }) { {isPending ? ( ) : ( - + )} ); diff --git a/components/cart/edit-item-quantity-button.tsx b/components/cart/edit-item-quantity-button.tsx index 7afdf23b1..a9c07b73b 100644 --- a/components/cart/edit-item-quantity-button.tsx +++ b/components/cart/edit-item-quantity-button.tsx @@ -1,10 +1,9 @@ import { useRouter } from 'next/navigation'; import { useTransition } from 'react'; +import { MinusIcon, PlusIcon } from '@heroicons/react/24/outline'; import clsx from 'clsx'; import { removeItem, updateItemQuantity } from 'components/cart/actions'; -import MinusIcon from 'components/icons/minus'; -import PlusIcon from 'components/icons/plus'; import LoadingDots from 'components/loading-dots'; import type { CartItem } from 'lib/shopify/types'; diff --git a/components/icons/arrow-left.tsx b/components/icons/arrow-left.tsx deleted file mode 100644 index 95d5af173..000000000 --- a/components/icons/arrow-left.tsx +++ /dev/null @@ -1,14 +0,0 @@ -export default function ArrowLeftIcon({ className }: { className?: string }) { - return ( - - - - - ); -} diff --git a/components/icons/caret-right.tsx b/components/icons/caret-right.tsx deleted file mode 100644 index fbed04236..000000000 --- a/components/icons/caret-right.tsx +++ /dev/null @@ -1,17 +0,0 @@ -export default function CaretRightIcon({ className }: { className?: string }) { - return ( - - - - ); -} diff --git a/components/icons/cart.tsx b/components/icons/cart.tsx index e54b77675..e2212627c 100644 --- a/components/icons/cart.tsx +++ b/components/icons/cart.tsx @@ -1,6 +1,5 @@ -import { ShoppingCartIcon } from '@heroicons/react/24/outline'; +import { ShoppingCartIcon, XMarkIcon } from '@heroicons/react/24/outline'; import clsx from 'clsx'; -import CloseIcon from './close'; export default function CartIcon({ className, @@ -14,7 +13,7 @@ export default function CartIcon({ return (
{icon === 'close' ? ( - + ) : ( - - - - ); -} diff --git a/components/icons/menu.tsx b/components/icons/menu.tsx deleted file mode 100644 index acaed1188..000000000 --- a/components/icons/menu.tsx +++ /dev/null @@ -1,16 +0,0 @@ -export default function MenuIcon({ className }: { className?: string }) { - return ( - - - - ); -} diff --git a/components/icons/minus.tsx b/components/icons/minus.tsx deleted file mode 100644 index 93c46e1dc..000000000 --- a/components/icons/minus.tsx +++ /dev/null @@ -1,16 +0,0 @@ -export default function MinusIcon({ className }: { className?: string }) { - return ( - - - - ); -} diff --git a/components/icons/plus.tsx b/components/icons/plus.tsx deleted file mode 100644 index 8ae449578..000000000 --- a/components/icons/plus.tsx +++ /dev/null @@ -1,17 +0,0 @@ -export default function PlusIcon({ className }: { className?: string }) { - return ( - - - - - ); -} diff --git a/components/icons/search.tsx b/components/icons/search.tsx deleted file mode 100644 index a03574025..000000000 --- a/components/icons/search.tsx +++ /dev/null @@ -1,11 +0,0 @@ -export default function SearchIcon({ className }: { className?: string }) { - return ( - - - - ); -} diff --git a/components/layout/navbar/mobile-menu.tsx b/components/layout/navbar/mobile-menu.tsx index 6ede894ae..5a873c0c2 100644 --- a/components/layout/navbar/mobile-menu.tsx +++ b/components/layout/navbar/mobile-menu.tsx @@ -5,8 +5,7 @@ import Link from 'next/link'; import { usePathname, useSearchParams } from 'next/navigation'; import { Fragment, useEffect, useState } from 'react'; -import CloseIcon from 'components/icons/close'; -import MenuIcon from 'components/icons/menu'; +import { Bars3Icon, XMarkIcon } from '@heroicons/react/24/outline'; import { Menu } from 'lib/shopify/types'; import Search from './search'; @@ -39,7 +38,7 @@ export default function MobileMenu({ menu }: { menu: Menu[] }) { className="md:hidden" data-testid="open-mobile-menu" > - + @@ -71,7 +70,7 @@ export default function MobileMenu({ menu }: { menu: Menu[] }) { aria-label="Close mobile menu" data-testid="close-mobile-menu" > - +
diff --git a/components/layout/navbar/search.tsx b/components/layout/navbar/search.tsx index fff895f43..7d8e44cde 100644 --- a/components/layout/navbar/search.tsx +++ b/components/layout/navbar/search.tsx @@ -2,7 +2,7 @@ import { useRouter, useSearchParams } from 'next/navigation'; -import SearchIcon from 'components/icons/search'; +import { MagnifyingGlassIcon } from '@heroicons/react/24/outline'; import { createUrl } from 'lib/utils'; export default function Search() { @@ -39,7 +39,7 @@ export default function Search() { className="w-full px-4 py-2 text-black dark:bg-black dark:text-gray-100" />
- +
); diff --git a/components/layout/search/filter/dropdown.tsx b/components/layout/search/filter/dropdown.tsx index 6f3e37f26..31daa25ce 100644 --- a/components/layout/search/filter/dropdown.tsx +++ b/components/layout/search/filter/dropdown.tsx @@ -3,7 +3,7 @@ import { usePathname, useSearchParams } from 'next/navigation'; import { useEffect, useRef, useState } from 'react'; -import Caret from 'components/icons/caret-right'; +import { ChevronDownIcon } from '@heroicons/react/24/outline'; import type { ListItem } from '.'; import { FilterItem } from './item'; @@ -45,7 +45,7 @@ export default function FilterItemDropdown({ list }: { list: ListItem[] }) { className="flex w-full items-center justify-between rounded border border-black/30 px-4 py-2 text-sm dark:border-white/30" >
{active}
- +
{openSelect && (
handleNavigate('previous')} > - +
) : null}