feat: SW-276 Optimized code removed vanilla implmentation
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user