mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Updates
This commit is contained in:
@@ -39,11 +39,11 @@ const ProductCard: FC<Props> = ({ product, className, variant = 'default' }) =>
|
||||
</div>
|
||||
|
||||
<div className={cn('flex flex-col items-start text-high-contrast', className)}>
|
||||
<Text className="mt-2 lg:mt-3" variant="listChildHeading">
|
||||
<Text className="mt-3" variant="listChildHeading">
|
||||
{product.title}
|
||||
</Text>
|
||||
<Price
|
||||
className="text-sm font-medium leading-tight lg:text-base"
|
||||
className="mt-1 text-sm font-bold leading-tight lg:text-base"
|
||||
amount={`${product.price.value}`}
|
||||
currencyCode={product.price.currencyCode ? product.price.currencyCode : 'SEK'}
|
||||
/>
|
||||
|
@@ -1,21 +1,21 @@
|
||||
'use client'
|
||||
'use client';
|
||||
|
||||
import { urlForImage } from 'lib/sanity/sanity.image'
|
||||
import { cn } from 'lib/utils'
|
||||
import Image from 'next/image'
|
||||
import { urlForImage } from 'lib/sanity/sanity.image';
|
||||
import { cn } from 'lib/utils';
|
||||
import Image from 'next/image';
|
||||
|
||||
interface SanityImageProps {
|
||||
image: object | any
|
||||
alt: string
|
||||
priority?: boolean
|
||||
width?: number
|
||||
height?: number
|
||||
quality?: number
|
||||
sizes?: string
|
||||
className?: string
|
||||
image: object | any;
|
||||
alt: string;
|
||||
priority?: boolean;
|
||||
width?: number;
|
||||
height?: number;
|
||||
quality?: number;
|
||||
sizes?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const placeholderImg = '/product-img-placeholder.svg'
|
||||
const placeholderImg = '/product-img-placeholder.svg';
|
||||
|
||||
export default function SanityImage(props: SanityImageProps) {
|
||||
const {
|
||||
@@ -26,10 +26,10 @@ export default function SanityImage(props: SanityImageProps) {
|
||||
height = 1080,
|
||||
width = 1080,
|
||||
sizes = '100vw',
|
||||
className,
|
||||
} = props
|
||||
className
|
||||
} = props;
|
||||
|
||||
const rootClassName = cn('w-full h-auto', className)
|
||||
const rootClassName = cn('w-full h-auto', className);
|
||||
|
||||
const image = source?.asset?._rev ? (
|
||||
<>
|
||||
@@ -39,11 +39,7 @@ export default function SanityImage(props: SanityImageProps) {
|
||||
width={width}
|
||||
height={height}
|
||||
alt={alt}
|
||||
src={urlForImage(source)
|
||||
.width(width)
|
||||
.height(height)
|
||||
.quality(quality)
|
||||
.url()}
|
||||
src={urlForImage(source).width(width).height(height).quality(quality).url()}
|
||||
sizes={sizes}
|
||||
priority={priority}
|
||||
blurDataURL={source.asset.metadata.lqip}
|
||||
@@ -61,7 +57,7 @@ export default function SanityImage(props: SanityImageProps) {
|
||||
priority={false}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
);
|
||||
|
||||
return image
|
||||
return image;
|
||||
}
|
||||
|
@@ -69,7 +69,7 @@ const Text: FunctionComponent<TextProps> = ({
|
||||
variant === 'productHeading',
|
||||
['max-w-prose font-display text-2xl font-extrabold leading-none md:text-3xl md:leading-none lg:text-4xl lg:leading-none']:
|
||||
variant === 'sectionHeading',
|
||||
['text-sm font-medium leading-tight lg:text-base']: variant === 'listChildHeading',
|
||||
['text-sm leading-tight lg:text-base']: variant === 'listChildHeading',
|
||||
['max-w-prose text-lg text-high-contrast lg:text-xl']: variant === 'label',
|
||||
['max-w-prose lg:text-lg 2xl:text-xl']: variant === 'paragraph'
|
||||
},
|
||||
|
Reference in New Issue
Block a user