Merged in feat/BOOK-377-keep-booking-widget-state (pull request #2894)

feat(BOOK-377): keep dates and rooms & guest in session storage

* feat(BOOK-377): keep dates and rooms & guest in session storage

* feat(BOOK-377): extract to hook and reuse


Approved-by: Erik Tiekstra
This commit is contained in:
Bianca Widstam
2025-10-06 09:33:09 +00:00
parent cbeba7eb08
commit f726b4f7e1
9 changed files with 137 additions and 16 deletions

View File

@@ -0,0 +1 @@
export const BOOKING_WIDGET_STATE = "bookingWidgetState"

View File

@@ -27,14 +27,8 @@ export function selectHotel(lang: Lang) {
export function selectHotelMap(lang: Lang) {
return `${hotelreservation(lang)}/select-hotel/map`
}
export function selectRateWithParams(
lang: Lang,
hotelId: string,
fromdate: string,
todate: string
) {
return `${hotelreservation(lang)}/select-rate?room%5B0%5D.adults=1&fromdate=${fromdate}&todate=${todate}&hotel=${hotelId}`
export function selectRateWithParams(lang: Lang, params: URLSearchParams) {
return `${hotelreservation(lang)}/select-rate?${params.toString()}`
}
export function alternativeHotels(lang: Lang) {

View File

@@ -14,6 +14,7 @@
"./polyfills": "./polyfills/index.ts",
"./constants/alert": "./constants/alert.ts",
"./constants/booking": "./constants/booking.ts",
"./constants/bookingWidget": "./constants/bookingWidget.ts",
"./constants/currency": "./constants/currency.ts",
"./constants/dateFormats": "./constants/dateFormats.ts",
"./constants/facilities": "./constants/facilities.ts",