diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2Mobile.tsx b/src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2Mobile.tsx new file mode 100644 index 0000000..828e8fc --- /dev/null +++ b/src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2Mobile.tsx @@ -0,0 +1,167 @@ +"use client"; + +import React, { Fragment, useState } from "react"; +import { Dialog, Tab, Transition } from "@headlessui/react"; +import { MagnifyingGlassIcon } from "@heroicons/react/24/outline"; +import { XMarkIcon } from "@heroicons/react/24/solid"; +import ButtonSubmit from "./ButtonSubmit"; +import { useTimeoutFn } from "react-use"; +import StaySearchForm from "./(stay-search-form)/StaySearchForm"; +import CarsSearchForm from "./(car-search-form)/CarsSearchForm"; +import FlightSearchForm from "./(flight-search-form)/FlightSearchForm"; + +const HeroSearchForm2Mobile = () => { + const [showModal, setShowModal] = useState(false); + + // FOR RESET ALL DATA WHEN CLICK CLEAR BUTTON + const [showDialog, setShowDialog] = useState(false); + let [, , resetIsShowingDialog] = useTimeoutFn(() => setShowDialog(true), 1); + // + function closeModal() { + setShowModal(false); + } + + function openModal() { + setShowModal(true); + } + + const renderButtonOpenModal = () => { + return ( + + ); + }; + + return ( +
+ {renderButtonOpenModal()} + + +
+
+ + + {showDialog && ( + +
+ +
+ + + {["Stay", "Experiences", "Cars", "Flights"].map( + (item, index) => ( + + {({ selected }) => ( +
+
+ {item} +
+ {selected && ( + + )} +
+ )} +
+ ) + )} +
+
+ + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+
+
+ + { + closeModal(); + }} + /> +
+
+ )} +
+
+
+
+
+
+
+ ); +}; + +export default HeroSearchForm2Mobile;