Implement touch event into product card component

This commit is contained in:
Daniele Pancottini 2023-03-04 10:22:11 +01:00
parent bb2c749524
commit 6714ae8d48

View File

@ -45,7 +45,14 @@ const ProductCard: FC<Props> = ({
<Card>
<CardBody>
<Link href={`/product/${product.slug}`}>
<a className={rootClassName} aria-label={product.name} onMouseOut={() => setIsHover(false)} onMouseOver={() => setIsHover(true)}>
<a
className={rootClassName}
aria-label={product.name}
onTouchStart={() => setIsHover(true)}
onTouchEnd={() => setIsHover(false)}
onMouseOut={() => setIsHover(false)}
onMouseOver={() => setIsHover(true)}
>
{variant === 'slim' && !isHover && (
<>
<div className={s.header}>