mirror of
https://github.com/vercel/commerce.git
synced 2025-05-16 14:36:59 +00:00
Implement touch event into product card component
This commit is contained in:
parent
bb2c749524
commit
6714ae8d48
@ -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}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user