diff --git a/components/HotelReservation/SelectRate/RoomFilter/index.tsx b/components/HotelReservation/SelectRate/RoomFilter/index.tsx index f2ae9d57f..c800c3cc9 100644 --- a/components/HotelReservation/SelectRate/RoomFilter/index.tsx +++ b/components/HotelReservation/SelectRate/RoomFilter/index.tsx @@ -4,8 +4,10 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useCallback, useEffect, useMemo } from "react" import { FormProvider, useForm } from "react-hook-form" import { useIntl } from "react-intl" +import { useMediaQuery } from "usehooks-ts" import { z } from "zod" +import { InfoCircleIcon } from "@/components/Icons" import CheckboxChip from "@/components/TempDesignSystem/Form/FilterChip/Checkbox" import Body from "@/components/TempDesignSystem/Text/Body" import Caption from "@/components/TempDesignSystem/Text/Caption" @@ -25,6 +27,8 @@ export default function RoomFilter({ onFilter, filterOptions, }: RoomFilterProps) { + const isAboveMobile = useMediaQuery("(min-width: 768px)") + const initialFilterValues = useMemo( () => filterOptions.reduce( @@ -55,6 +59,8 @@ export default function RoomFilter({ id: "Pet-friendly rooms have an additional fee of 20 EUR per stay", }) + const showTooltip = isAboveMobile && petFriendly + const submitFilter = useCallback(() => { const data = getValues() onFilter(data) @@ -77,19 +83,50 @@ export default function RoomFilter({
({ className={styles.tooltipContainer} role="tooltip" aria-label={text} - onClick={handleToggle} - onTouchStart={handleToggle} + tabIndex={0} + onClick={isTouchable ? undefined : handleToggle} + onTouchStart={isTouchable ? handleToggle : undefined} + onKeyDown={handleKeyDown} data-active={isActive} >
{ text?: string position: P arrow: ValidArrow
+ isTouchable?: boolean }