forked from crowetic/commerce
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 { FC } from 'react'
|
||||||
import { useInView } from 'react-intersection-observer'
|
import { useInView } from 'react-intersection-observer'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import s from './EnhancedImage.module.css'
|
|
||||||
|
|
||||||
type Props = Omit<
|
type Props = Omit<
|
||||||
JSX.IntrinsicElements['img'],
|
JSX.IntrinsicElements['img'],
|
||||||
@ -34,7 +33,7 @@ const EnhancedImage: FC<Props & JSX.IntrinsicElements['img']> = ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={ref} className={s.root}>
|
<div ref={ref}>
|
||||||
<Image {...props} />
|
<Image {...props} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
@ -122,3 +122,11 @@
|
|||||||
.wishlistButton {
|
.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;
|
@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>
|
</div>
|
||||||
<EnhancedImage
|
<EnhancedImage
|
||||||
alt={p.name}
|
alt={p.name}
|
||||||
className="w-full object-cover"
|
className={cn('w-full object-cover', s['product-image'])}
|
||||||
src={src}
|
src={src}
|
||||||
width={imgWidth}
|
width={imgWidth}
|
||||||
height={imgHeight}
|
height={imgHeight}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user