From 9ec366a5006bed7775610f40b9dbaa0c1c6eb44b Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Thu, 14 Nov 2024 14:52:30 +0100 Subject: [PATCH] feat(SW-892) Show toolTip on button hover --- .../SelectRate/RoomFilter/index.tsx | 52 ++++++++++++------- .../Form/FilterChip/_Chip/index.tsx | 11 ++-- types/components/form/filterChip.ts | 2 +- 3 files changed, 38 insertions(+), 27 deletions(-) diff --git a/components/HotelReservation/SelectRate/RoomFilter/index.tsx b/components/HotelReservation/SelectRate/RoomFilter/index.tsx index fb41f3cc7..a07e8353f 100644 --- a/components/HotelReservation/SelectRate/RoomFilter/index.tsx +++ b/components/HotelReservation/SelectRate/RoomFilter/index.tsx @@ -98,26 +98,38 @@ export default function RoomFilter({
- {filterOptions.map((option) => ( - - ))} + {filterOptions.map((option) => { + const { code, description } = option + const isPetRoom = code === RoomPackageCodeEnum.PET_ROOM + const isAllergyRoom = code === RoomPackageCodeEnum.ALLERGY_ROOM + const isDisabled = + (isAllergyRoom && petFriendly) || (isPetRoom && allergyFriendly) + + const checkboxChip = ( + + ) + + return isPetRoom ? ( + + {checkboxChip} + + ) : ( + checkboxChip + ) + })}
diff --git a/components/TempDesignSystem/Form/FilterChip/_Chip/index.tsx b/components/TempDesignSystem/Form/FilterChip/_Chip/index.tsx index 2d11e1173..12992bbc4 100644 --- a/components/TempDesignSystem/Form/FilterChip/_Chip/index.tsx +++ b/components/TempDesignSystem/Form/FilterChip/_Chip/index.tsx @@ -3,7 +3,6 @@ import { useFormContext } from "react-hook-form" import { HeartIcon, InfoCircleIcon } from "@/components/Icons" import Caption from "@/components/TempDesignSystem/Text/Caption" -import { Tooltip } from "@/components/TempDesignSystem/Tooltip" import styles from "./chip.module.css" @@ -20,7 +19,7 @@ export default function FilterChip({ value, selected, disabled, - tooltipText, + hasTooltip, }: FilterChipProps) { const { register } = useFormContext() @@ -45,11 +44,11 @@ export default function FilterChip({ {label} - {tooltipText && ( - - - + + {hasTooltip && ( + )} +