From 2a11928120688be8611478a259eea8462f78d6fe Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Sep 2023 17:28:41 +0300 Subject: [PATCH] Added StayDatesRangeInput component Updated tests to cover new component --- .../(stay-search-form)/StaySearchForm.tsx | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/app/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StaySearchForm.tsx diff --git a/src/app/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StaySearchForm.tsx b/src/app/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StaySearchForm.tsx new file mode 100644 index 0000000..42f3dcd --- /dev/null +++ b/src/app/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StaySearchForm.tsx @@ -0,0 +1,36 @@ +import React, { FC } from "react"; +import LocationInput from "../LocationInput"; +import GuestsInput from "../GuestsInput"; +import StayDatesRangeInput from "./StayDatesRangeInput"; +import { StaySearchFormFields } from "../../type"; + +export interface StaySearchFormProps { + defaultFieldFocus?: StaySearchFormFields; +} + +const StaySearchForm: FC = ({ defaultFieldFocus }) => { + const renderForm = () => { + return ( +
+ setDateFocused("startDate")} + className="flex-[1.5]" + autoFocus={defaultFieldFocus === "location"} + /> +
+ + +
+ + + ); + }; + + return renderForm(); +}; + +export default StaySearchForm;