fix: booking widget locking scroll

This commit is contained in:
Christel Westerberg
2024-11-18 15:04:37 +01:00
parent 4c9e9de113
commit 9094b08345
3 changed files with 4 additions and 4 deletions

View File

@@ -177,7 +177,7 @@ export default function BookingWidgetClient({
> >
<CloseLargeIcon /> <CloseLargeIcon />
</button> </button>
<Form locations={locations} type={type} setIsOpen={setIsOpen} /> <Form locations={locations} type={type} onClose={closeMobileSearch} />
</div> </div>
</section> </section>
<div className={styles.backdrop} onClick={closeMobileSearch} /> <div className={styles.backdrop} onClick={closeMobileSearch} />

View File

@@ -20,7 +20,7 @@ const formId = "booking-widget"
export default function Form({ export default function Form({
locations, locations,
type, type,
setIsOpen, onClose,
}: BookingWidgetFormProps) { }: BookingWidgetFormProps) {
const router = useRouter() const router = useRouter()
const lang = useLang() const lang = useLang()
@@ -56,7 +56,7 @@ export default function Form({
) )
}) })
}) })
setIsOpen(false) onClose()
router.push(`${bookingFlowPage}?${bookingWidgetParams.toString()}`) router.push(`${bookingFlowPage}?${bookingWidgetParams.toString()}`)
} }

View File

@@ -4,7 +4,7 @@ import type { Location, Locations } from "@/types/trpc/routers/hotel/locations"
export interface BookingWidgetFormProps { export interface BookingWidgetFormProps {
locations: Locations locations: Locations
type?: BookingWidgetType type?: BookingWidgetType
setIsOpen: (isOpen: boolean) => void onClose: () => void
} }
export interface BookingWidgetFormContentProps { export interface BookingWidgetFormContentProps {