feat: SW-276 Optimized code

This commit is contained in:
Hrishikesh Vaipurkar
2024-10-10 13:44:33 +02:00
parent 2c6ef3fea7
commit f1f1434c9d
8 changed files with 45 additions and 51 deletions

View File

@@ -3,7 +3,7 @@
import { useCallback, useEffect, useRef, useState } from "react"
import { useIntl } from "react-intl"
import { guestsRoomsStore } from "@/stores/guests-rooms"
import { useGuestsRoomsStore } from "@/stores/guests-rooms"
import { guestRoomsSchema } from "@/components/Forms/BookingWidget/schema"
import Body from "@/components/TempDesignSystem/Text/Body"
@@ -15,7 +15,8 @@ import styles from "./guests-rooms-picker.module.css"
export default function GuestsRoomsPickerForm() {
const intl = useIntl()
const [isOpen, setIsOpen] = useState(false)
const { rooms, adultCount, childCount, setIsValidated } = guestsRoomsStore()
const { rooms, adultCount, childCount, setIsValidated } =
useGuestsRoomsStore()
const ref = useRef<HTMLDivElement | null>(null)
function handleOnClick() {
setIsOpen((prevIsOpen) => !prevIsOpen)