diff --git a/components/carousel.tsx b/components/carousel.tsx index d86d17f45..2a8d2526f 100644 --- a/components/carousel.tsx +++ b/components/carousel.tsx @@ -1,6 +1,7 @@ import { getCollectionProducts } from 'lib/shopify'; import Image from 'next/image'; import Link from 'next/link'; +import Label from './label'; export async function Carousel() { // Collections that start with `hidden-*` are hidden from the search page. @@ -9,13 +10,13 @@ export async function Carousel() { if (!products?.length) return null; return ( -
-
+
+
{[...products, ...products].map((product, i) => ( {product.featuredImage ? ( ) : null} -
-
- {product.title} -
-
+
diff --git a/components/grid/index.tsx b/components/grid/index.tsx index 07dc0d2a9..346a7833b 100644 --- a/components/grid/index.tsx +++ b/components/grid/index.tsx @@ -2,7 +2,7 @@ import clsx from 'clsx'; function Grid(props: React.ComponentProps<'ul'>) { return ( -
    +
      {props.children}
    ); diff --git a/components/grid/three-items.tsx b/components/grid/three-items.tsx index 2280de26e..f0a34a375 100644 --- a/components/grid/three-items.tsx +++ b/components/grid/three-items.tsx @@ -3,26 +3,18 @@ import { getCollectionProducts } from 'lib/shopify'; import type { Product } from 'lib/shopify/types'; import Link from 'next/link'; -function ThreeItemGridItem({ - item, - size, - background -}: { - item: Product; - size: 'full' | 'half'; - background: 'white' | 'pink' | 'purple' | 'black'; -}) { +function ThreeItemGridItem({ item, size }: { item: Product; size: 'full' | 'half' }) { return (
    - + - - - +
    + + +
    ); } diff --git a/components/grid/tile.tsx b/components/grid/tile.tsx index b2f219276..6ddb31a65 100644 --- a/components/grid/tile.tsx +++ b/components/grid/tile.tsx @@ -1,18 +1,17 @@ import clsx from 'clsx'; import Image from 'next/image'; - -import Price from 'components/price'; +import Label from '../label'; export function GridTileImage({ isInteractive = true, - background, active, + labelPosition, labels, ...props }: { isInteractive?: boolean; - background?: 'white' | 'pink' | 'purple' | 'black' | 'purple-dark' | 'blue' | 'cyan' | 'gray'; active?: boolean; + labelPosition?: 'bottom' | 'center'; labels?: { title: string; amount: string; @@ -22,18 +21,12 @@ export function GridTileImage({ } & React.ComponentProps) { return (
    {active !== undefined && active ? ( @@ -48,22 +41,13 @@ export function GridTileImage({ /> ) : null} {labels ? ( -
    -

    - {labels.title} -

    - -
    +
    ); diff --git a/components/label.tsx b/components/label.tsx new file mode 100644 index 000000000..4fadc0480 --- /dev/null +++ b/components/label.tsx @@ -0,0 +1,41 @@ +import clsx from 'clsx'; +import Price from './price'; + +const Label = ({ + title, + amount, + currencyCode, + position, + size +}: { + title: string; + amount: string; + currencyCode: string; + position?: 'bottom' | 'center'; + size?: 'large' | 'small'; +}) => { + return ( +
    +

    + {title} +

    + +
    + ); +}; + +export default Label; diff --git a/components/product/gallery.tsx b/components/product/gallery.tsx index 7ee154b57..2d5bfecea 100644 --- a/components/product/gallery.tsx +++ b/components/product/gallery.tsx @@ -41,7 +41,6 @@ export function Gallery({ height={600} isInteractive={false} priority={true} - background="purple" labels={{ title, amount, @@ -86,7 +85,6 @@ export function Gallery({ src={image.src} width={600} height={600} - background="purple-dark" active={isActive} />