mirror of
https://github.com/vercel/commerce.git
synced 2025-05-17 06:56: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>
|
<Card>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<Link href={`/product/${product.slug}`}>
|
<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 && (
|
{variant === 'slim' && !isHover && (
|
||||||
<>
|
<>
|
||||||
<div className={s.header}>
|
<div className={s.header}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user