mirror of
https://github.com/vercel/commerce.git
synced 2025-03-14 14:42:31 +00:00
improve the images
This commit is contained in:
parent
96d5a37fd1
commit
0478b43e9c
@ -1,14 +0,0 @@
|
||||
.root {
|
||||
@apply transform transition-transform duration-500;
|
||||
height: 100%;
|
||||
margin: auto;
|
||||
|
||||
&:hover {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
& div {
|
||||
height: 100%;
|
||||
margin: auto;
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
import { FC } from 'react'
|
||||
import { useInView } from 'react-intersection-observer'
|
||||
import Image from 'next/image'
|
||||
import s from './EnhancedImage.module.css'
|
||||
|
||||
type Props = Omit<
|
||||
JSX.IntrinsicElements['img'],
|
||||
@ -34,7 +33,7 @@ const EnhancedImage: FC<Props & JSX.IntrinsicElements['img']> = ({
|
||||
})
|
||||
|
||||
return (
|
||||
<div ref={ref} className={s.root}>
|
||||
<div ref={ref}>
|
||||
<Image {...props} />
|
||||
</div>
|
||||
)
|
||||
|
@ -122,3 +122,11 @@
|
||||
.wishlistButton {
|
||||
@apply w-10 h-10 flex ml-auto items-center justify-center bg-primary text-primary font-semibold text-xs leading-6 cursor-pointer;
|
||||
}
|
||||
|
||||
.product-image {
|
||||
margin: auto;
|
||||
|
||||
& div {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ const ProductCard: FC<Props> = ({
|
||||
</div>
|
||||
<EnhancedImage
|
||||
alt={p.name}
|
||||
className="w-full object-cover"
|
||||
className={cn('w-full object-cover', s['product-image'])}
|
||||
src={src}
|
||||
width={imgWidth}
|
||||
height={imgHeight}
|
||||
|
Loading…
x
Reference in New Issue
Block a user