From 4009f2eba6e141af160879112bd601ad755905cf Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Sep 2023 17:42:46 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Implemented=20mobile=20search=20?= =?UTF-8?q?form=20=E2=9C=A8=20Added=20dialog=20functionality=20?= =?UTF-8?q?=F0=9F=93=B1=20Improved=20mobile=20UI=20=F0=9F=90=9B=20Fixed=20?= =?UTF-8?q?bug=20in=20search=20form=20=F0=9F=93=A6=20Refactored=20code=20s?= =?UTF-8?q?tructure=20=F0=9F=8C=9F=20Enhanced=20user=20experience=20?= =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20Optimized=20performance=20=F0=9F=94=84?= =?UTF-8?q?=20Updated=20dependencies=20=F0=9F=A7=B9=20Removed=20redundant?= =?UTF-8?q?=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HeroSearchForm2Mobile.tsx | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2Mobile.tsx 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;