fix(SW-350): Close booking widget on search (mobile)
This commit is contained in:
@@ -173,7 +173,7 @@ export default function BookingWidgetClient({
|
||||
>
|
||||
<CloseLargeIcon />
|
||||
</button>
|
||||
<Form locations={locations} type={type} />
|
||||
<Form locations={locations} type={type} setIsOpen={setIsOpen} />
|
||||
</div>
|
||||
</section>
|
||||
<div className={styles.backdrop} onClick={closeMobileSearch} />
|
||||
|
||||
@@ -17,7 +17,11 @@ import { Location } from "@/types/trpc/routers/hotel/locations"
|
||||
|
||||
const formId = "booking-widget"
|
||||
|
||||
export default function Form({ locations, type }: BookingWidgetFormProps) {
|
||||
export default function Form({
|
||||
locations,
|
||||
type,
|
||||
setIsOpen,
|
||||
}: BookingWidgetFormProps) {
|
||||
const router = useRouter()
|
||||
const lang = useLang()
|
||||
|
||||
@@ -52,7 +56,7 @@ export default function Form({ locations, type }: BookingWidgetFormProps) {
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
setIsOpen(false)
|
||||
router.push(`${bookingFlowPage}?${bookingWidgetParams.toString()}`)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
import { FormState, UseFormReturn } from "react-hook-form"
|
||||
|
||||
import type {
|
||||
BookingWidgetSchema,
|
||||
BookingWidgetType,
|
||||
} from "@/types/components/bookingWidget"
|
||||
import type { BookingWidgetType } from "@/types/components/bookingWidget"
|
||||
import type { Location, Locations } from "@/types/trpc/routers/hotel/locations"
|
||||
|
||||
export interface BookingWidgetFormProps {
|
||||
locations: Locations
|
||||
type?: BookingWidgetType
|
||||
setIsOpen: (isOpen: boolean) => void
|
||||
}
|
||||
|
||||
export interface BookingWidgetFormContentProps {
|
||||
|
||||
Reference in New Issue
Block a user