feat(SW-340): Hover actions
This commit is contained in:
@@ -24,6 +24,7 @@ export default function HotelCard({
|
||||
hotel,
|
||||
type = HotelCardListingTypeEnum.PageListing,
|
||||
state = "default",
|
||||
onHotelCardHover,
|
||||
}: HotelCardProps) {
|
||||
const intl = useIntl()
|
||||
|
||||
@@ -37,8 +38,25 @@ export default function HotelCard({
|
||||
state,
|
||||
})
|
||||
|
||||
const handleMouseEnter = () => {
|
||||
console.log("handleMouseEnter", hotelData.name)
|
||||
if (onHotelCardHover) {
|
||||
console.log("onHotelCardHover", hotelData.name)
|
||||
onHotelCardHover(hotelData.name)
|
||||
}
|
||||
}
|
||||
const handleMouseLeave = () => {
|
||||
if (onHotelCardHover) {
|
||||
onHotelCardHover(null)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<article className={classNames}>
|
||||
<article
|
||||
className={classNames}
|
||||
onMouseEnter={handleMouseEnter}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
>
|
||||
<section className={styles.imageContainer}>
|
||||
{hotelData.gallery && (
|
||||
<ImageGallery
|
||||
|
||||
Reference in New Issue
Block a user