feat: SW-276 Optimized code

This commit is contained in:
Hrishikesh Vaipurkar
2024-10-11 18:32:56 +02:00
parent d52a347904
commit b8f7f91fb4
7 changed files with 58 additions and 31 deletions

View File

@@ -15,8 +15,10 @@ 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 } =
useGuestsRoomsStore()
const rooms = useGuestsRoomsStore.use.rooms()
const adultCount = useGuestsRoomsStore.use.adultCount()
const childCount = useGuestsRoomsStore.use.childCount()
const setIsValidated = useGuestsRoomsStore.use.setIsValidated()
const ref = useRef<HTMLDivElement | null>(null)
function handleOnClick() {
setIsOpen((prevIsOpen) => !prevIsOpen)