feat: SW-276 Optimized code removed vanilla implmentation

This commit is contained in:
Hrishikesh Vaipurkar
2024-10-15 10:43:32 +02:00
parent adb63a827e
commit b2290b7ad3
8 changed files with 37 additions and 42 deletions

View File

@@ -15,10 +15,14 @@ import styles from "./guests-rooms-picker.module.css"
export default function GuestsRoomsPickerForm() {
const intl = useIntl()
const [isOpen, setIsOpen] = useState(false)
const rooms = useGuestsRoomsStore.use.rooms()
const adultCount = useGuestsRoomsStore.use.adultCount()
const childCount = useGuestsRoomsStore.use.childCount()
const setIsValidated = useGuestsRoomsStore.use.setIsValidated()
const { rooms, adultCount, childCount, setIsValidated } = useGuestsRoomsStore(
(state) => ({
rooms: state.rooms,
adultCount: state.adultCount,
childCount: state.childCount,
setIsValidated: state.setIsValidated,
})
)
const ref = useRef<HTMLDivElement | null>(null)
function handleOnClick() {
setIsOpen((prevIsOpen) => !prevIsOpen)