Updated Image Component implementation

This commit is contained in:
Luis Alvarez
2020-10-22 20:59:45 -05:00
parent ce8f0235f5
commit e0b1106980
8 changed files with 39 additions and 62 deletions

View File

@@ -3,7 +3,6 @@ import cn from 'classnames'
import Image from 'next/image'
import Link from 'next/link'
import type { ProductNode } from '@lib/bigcommerce/api/operations/get-all-products'
import getPathname from '@lib/get-pathname'
import { Heart } from '@components/icon'
import s from './ProductCard.module.css'
@@ -25,7 +24,7 @@ const ProductCard: FC<Props> = ({
imgHeight,
priority,
}) => {
const src = getPathname(p.images.edges?.[0]?.node.urlOriginal!)
const src = p.images.edges?.[0]?.node.urlOriginal!
if (variant === 'slim') {
return (
@@ -40,6 +39,7 @@ const ProductCard: FC<Props> = ({
width={imgWidth}
height={imgHeight}
priority={priority}
quality="90"
/>
</div>
)
@@ -69,6 +69,7 @@ const ProductCard: FC<Props> = ({
width={imgWidth}
height={imgHeight}
priority={priority}
quality="90"
/>
</div>
</a>