From be53fcef1679fe903c3b3b408e6c6a0cc9103fe3 Mon Sep 17 00:00:00 2001 From: Jonatan Schultz Date: Thu, 26 Aug 2021 17:12:37 +0200 Subject: [PATCH] Rem unused props & variants --- .../product/ProductCard/ProductCard.tsx | 116 ++++-------------- 1 file changed, 24 insertions(+), 92 deletions(-) diff --git a/components/product/ProductCard/ProductCard.tsx b/components/product/ProductCard/ProductCard.tsx index 5b4e46d0f..ff760bfe5 100644 --- a/components/product/ProductCard/ProductCard.tsx +++ b/components/product/ProductCard/ProductCard.tsx @@ -3,27 +3,20 @@ import cn from 'classnames' import Link from 'next/link' import type { Product } from '@commerce/types/product' import s from './ProductCard.module.css' -import Image, { ImageProps } from 'next/image' -import WishlistButton from '@components/wishlist/WishlistButton' +import Image from 'next/image' import usePrice from '@framework/product/use-price' -import ProductTag from '../ProductTag' interface Props { className?: string product: Product noNameTag?: boolean - imgProps?: Omit - variant?: 'default' | 'slim' | 'simple' } const placeholderImg = '/product-img-placeholder.svg' const ProductCard: FC = ({ product, - imgProps, className, - noNameTag = false, - variant = 'default', }) => { const { price } = usePrice({ amount: product.price.value, @@ -33,101 +26,40 @@ const ProductCard: FC = ({ const rootClassName = cn( s.root, - { [s.slim]: variant === 'slim', [s.simple]: variant === 'simple' }, className ) return ( - {variant === 'slim' && ( - <> -
- {product.name} -
+
+
{product?.images && ( {product.name )} - - )} - - {variant === 'simple' && ( - <> - {process.env.COMMERCE_WISHLIST_ENABLED && ( - - )} - {!noNameTag && ( -
-

- {product.name} -

-
- {`${price} ${product.price?.currencyCode}`} -
-
- )} -
- {product?.images && ( - {product.name - )} -
- - )} - - {variant === 'default' && ( - <> -
-
- {product?.images && ( - {product.name - )} -
-
- -
-
-
- {product.name} -
-
- Author (missing data) -
-
{price}
- - )} +
+
+ +
+
+
+ {product.name} +
+
+ Author (missing data) +
+
{price}
)