From 487264080065a61d672dff7c6f2a572875ff38e8 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Sep 2023 17:40:16 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Work=20in=20progress:=20HeroSear?= =?UTF-8?q?chForm2RealEstateMobile=20component=20=F0=9F=94=8D=20Added=20mo?= =?UTF-8?q?dal=20functionality=20for=20property=20search=20=F0=9F=8E=A8=20?= =?UTF-8?q?Improved=20button=20styles=20=F0=9F=A9=B9=20Fixed=20minor=20sty?= =?UTF-8?q?ling=20issues=20=F0=9F=93=9D=20Updated=20comments=20and=20docum?= =?UTF-8?q?entation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HeroSearchForm2RealEstateMobile.tsx | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2RealEstateMobile.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2RealEstateMobile.tsx b/src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2RealEstateMobile.tsx new file mode 100644 index 0000000..66170bb --- /dev/null +++ b/src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2RealEstateMobile.tsx @@ -0,0 +1,156 @@ +"use client"; + +import { Dialog, Tab, Transition } from "@headlessui/react"; +import { MagnifyingGlassIcon } from "@heroicons/react/24/outline"; +import { XMarkIcon } from "@heroicons/react/24/solid"; +import React, { Fragment, useState } from "react"; +import ButtonSubmit from "./ButtonSubmit"; +import { useTimeoutFn } from "react-use"; +import RealestateSearchForm from "./(real-estate-search-form)/RealestateSearchForm"; + +const HeroSearchForm2RealEstateMobile = () => { + 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 && ( + +
+ +
+ + + {["Buy", "Rent", "Sold"].map((item, index) => ( + + {({ selected }) => ( +
+
+ {item} +
+ {selected && ( + + )} +
+ )} +
+ ))} +
+
+ + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+
+
+ + { + closeModal(); + }} + /> +
+
+ )} +
+
+
+
+
+
+
+ ); +}; + +export default HeroSearchForm2RealEstateMobile;