From a8814983a6dad2142e616e6646a99b2ffd5134c6 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 6 Jan 2021 17:01:32 -0300 Subject: [PATCH] changes --- .../ProductCard/FUTURE_ProductCard.tsx | 57 +++++++++++++++++++ framework/types.d.ts | 25 ++++++++ 2 files changed, 82 insertions(+) create mode 100644 components/product/ProductCard/FUTURE_ProductCard.tsx create mode 100644 framework/types.d.ts diff --git a/components/product/ProductCard/FUTURE_ProductCard.tsx b/components/product/ProductCard/FUTURE_ProductCard.tsx new file mode 100644 index 000000000..0b5c3aece --- /dev/null +++ b/components/product/ProductCard/FUTURE_ProductCard.tsx @@ -0,0 +1,57 @@ +import { FC } from 'react' +import cn from 'classnames' +import Image from 'next/image' +import s from './ProductCard.module.css' +// import WishlistButton from '@components/wishlist/WishlistButton' + +interface Props { + className?: string + product: Product + variant?: 'slim' | 'simple' +} + +const ProductCard: FC = ({ className, product, variant }) => { + const defaultImageProps = { + layout: 'responsive', + } + + return ( + + {variant === 'slim' ? ( +
+
+ + {product.name} + + {/* Image */} +
+
+ ) : ( + <> +
+
+
+

+ {product.name} +

+ {product.price} +
+
+
+ {/* Image */} + + {product.name} +
+ + )} +
+ ) +} + +export default ProductCard diff --git a/framework/types.d.ts b/framework/types.d.ts new file mode 100644 index 000000000..40d7390a7 --- /dev/null +++ b/framework/types.d.ts @@ -0,0 +1,25 @@ +interface Product { + id: string | number + name: string + description: string + images: Images[] + slug: string + price: string + variantId: string +} + +interface Images { + src: string + alt?: string +} + +interface NextImage { + src: string + width: number | string + height: number | string + layout?: 'fixed' | 'intrinsic' | 'responsive' | undefined + priority?: boolean + loading?: 'eager' | 'lazy' + sizes?: string + alt?: string +}