@roomstay/frontend 2.6.39 → 2.6.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.bundle.js +1 -1
- package/dist/src/components/navigation/Header.js +22 -4
- package/dist/src/components/navigation/Header.js.map +1 -1
- package/dist/src/components/steps/date/PeoplePickerRow.js +47 -60
- package/dist/src/components/steps/date/PeoplePickerRow.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateDescriptionTab.js +2 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateDescriptionTab.js.map +1 -1
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js +1 -0
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js.map +1 -1
- package/dist/src/models/Api/HotelDTO.d.ts +1 -1
- package/dist/src/models/Api/HotelDTO.js.map +1 -1
- package/dist/src/models/Client/Hotel/Hotel.d.ts +4 -0
- package/dist/src/models/Client/Hotel/Hotel.js.map +1 -1
- package/dist/src/pages/hotel/HotelInfo.js +20 -15
- package/dist/src/pages/hotel/HotelInfo.js.map +1 -1
- package/dist/test.bundle.js +1 -1
- package/dist/vendors.bundle.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompanyContextWrapper.js","sourceRoot":"/","sources":["src/contexts/CompanyContext/CompanyContextWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0G;AAC1G,6CAA4D;AAC5D,2CAA2C;AAC3C,yCAAiE;AACjE,+CAAiG;AAEjG,kEAAmC;AACnC,kGAA+F;AAK/F,uFAA8E;AAE9E,kFAA0D;AAC1D,mEAAwD;AACxD,8FAAsE;AACtE,sEAAwD;AACxD,iEAAyC;AACzC,qEAA6C;AAC7C,mEAA2C;AAOpC,MAAM,qBAAqB,GAAG,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAA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GAAG,EAAE,CAAC,CAAC;YAE3F,IAAI,WAAW,EAAE;gBACb,kBAAkB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBACxC,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,sCAAsC;gBACtC,OAAO,CAAC,GAAG,CAAC,uEAAuE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;gBAC5G,OAAO,KAAK,CAAC;aAChB;QACL,CAAC;QAED,sBAAsB,EAAE,GAAG,EAAE;YACzB,cAAc,CAAC,KAAK,CAAC,CAAC;YACtB,2BAA2B,CAAC,IAAI,CAAC,CAAC;QACtC,CAAC;QACD,qBAAqB,EAAE,CAAC,SAAsB,EAAE,EAAE;YAC9C,cAAc,CAAC,IAAI,CAAC,CAAC;YAErB,IAAI,SAAS,EAAE;gBACX,2BAA2B,CAAC,SAAS,CAAC,CAAC;aAC1C;QACL,CAAC;QAED,UAAU;QACV,WAAW;QAEX,kBAAkB;QAClB,kBAAkB;QAElB,QAAQ;QACR,kBAAkB;QAClB,qBAAqB;QACrB,YAAY,EAAE,YAAY;QAC1B,aAAa;KAChB,CAAC;IAEF,OAAO,8BAAC,yBAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,cAAc,IAAG,QAAQ,CAA2B,CAAC;AAChG,CAAC,CAAC;AAtdW,QAAA,qBAAqB,yBAsdhC","sourcesContent":["import { BookingEngineContext, CompanyContext, CompanyContextType, SignInUser } from '@frontend/contexts';\nimport { InitialHotelDetailsEvent } from '@frontend/events';\nimport { useEvent } from '@frontend/hooks';\nimport { EIntegration, IHotelColorScheme } from '@roomstay/core';\nimport React, { ReactChild, useCallback, useContext, useEffect, useMemo, useState } from 'react';\n\nimport API from '@/api/BookingAPI';\nimport { MemberOnlyFenceSignUp } from '@/events/actions/MemberOnlyFence/MemberOnlyFenceSignUp';\nimport { HotelDTO } from '@/models/Api/HotelDTO';\nimport BasketRow from '@/models/BasketRow';\nimport type { ConfigCompany } from '@/models/Client/Hotel/Company';\nimport type { ConfigHotel, Hotel, InitialHotelDetailsEventPayload } from '@/models/Client/Hotel/Hotel';\nimport { HotelDataSource } from '@/models/Client/Hotel/HotelDataSource.types';\nimport { IPromotion } from '@/models/Promotion/IPromotion.type';\nimport StepHotel from '@/pages/steps/StepHotel/StepHotel';\nimport { Language } from '@/providers/LanguageProvider';\nimport StaticContextProvider from '@/providers/StaticContextProvider';\nimport * as currencyHelper from '@/util/CurrencyHelper';\nimport DataLayer from '@/util/DataLayer';\nimport StepManager from '@/util/StepManager';\nimport TimeHelper from '@/util/TimeHelper';\n\ninterface CompanyContextWrapperProps {\n children: ReactChild;\n configCompany: ConfigCompany;\n}\n\nexport const CompanyContextWrapper = ({ configCompany: company, children }: CompanyContextWrapperProps) => {\n const beContext = useContext(BookingEngineContext);\n\n const getSelectedHotel = () => {\n for (const hotel of hotels) {\n if (selectedHotelID + '' === hotel.hotelID + '') {\n return hotel;\n }\n }\n };\n\n const [name, setName] = useState(company.name);\n const [companyShort, setCompanyShort] = useState(company.companyShort);\n const [logo, setLogo] = useState(company.logo);\n const [colors, setColors] = useState(company.colors);\n const [hotels, setHotels] = useState<Hotel[]>(company.hotels as Hotel[]);\n const [logoLink, setLogoLink] = useState(company.logoLink);\n const [brandSuffix, setBrandSuffix] = useState(company.brandSuffix);\n\n const [selectedHotelID, setSelectedHotelID] = useState<string>();\n\n const selectedHotel = useMemo(() => {\n for (const companyHotel of hotels) {\n if (selectedHotelID + '' === companyHotel.hotelID + '') {\n return companyHotel;\n }\n }\n }, [hotels, selectedHotelID]);\n\n const [currentCurrency, setCurrentCurrency] = useState<string>(getSelectedHotel()?.defaultCurrency ?? 'AUD');\n const [currentLanguage, setCurrentLanguage] = useState<Language>(getSelectedHotel()?.defaultLanguage ?? Language.en_us);\n\n const [memberOnlyModalPromotion, setMemberOnlyModalPromotion] = useState<IPromotion | null>(null);\n\n const [signedInUser, setSignedInUser] = useState<SignInUser | null>(null);\n const [isSigningIn, setIsSigningIn] = useState(false);\n\n const [memberNumber, setMemberNumber] = useState<string>();\n const [isExternalMemberHotel, setIsExternalMemberHotel] = useState<boolean>(false);\n\n const externalMemberType = useMemo(() => {\n const integrations = selectedHotel?.integrations;\n\n // Because integrations is an array of strings technically both Big4 and Top10 theoretically come down, so we'll choose one\n if (integrations?.includes(EIntegration.Big4)) {\n return EIntegration.Big4;\n } else if (integrations?.includes(EIntegration.Top10)) {\n return EIntegration.Top10;\n } else if (integrations?.includes(EIntegration.RmsTop10)) {\n return EIntegration.RmsTop10;\n } else if (integrations?.includes(EIntegration.Gday)) {\n return EIntegration.Gday;\n } else if (integrations?.includes(EIntegration.Salesforce)) {\n return EIntegration.Salesforce;\n }\n }, [selectedHotel]);\n\n useEffect(() => {\n const isExternalProvider =\n selectedHotel?.integrations?.some(\n (provider) =>\n provider === EIntegration.Big4 ||\n provider === EIntegration.Top10 ||\n provider === EIntegration.RmsTop10 ||\n provider === EIntegration.Gday ||\n provider === EIntegration.Salesforce\n ) || false;\n setIsExternalMemberHotel(isExternalProvider);\n }, [selectedHotel]);\n\n const { raise } = useEvent();\n\n const getHotelFromArrayWithId = (id: string, arrayOfHotels: Hotel[] | ConfigHotel[]) => {\n for (const nextHotel of arrayOfHotels) {\n if (nextHotel.hotelID + '' === id + '') {\n return nextHotel;\n }\n }\n };\n const getHotelFromID = (id: string): Hotel => {\n return getHotelFromArrayWithId(id, hotels) as Hotel;\n };\n\n const updateHotel = (newHotel: Hotel, callback?: (hotel: Hotel) => Hotel) => {\n setHotels((oldHotels) => {\n let modified = false;\n const newHotelArray = oldHotels.map((mappingHotel) => {\n if (mappingHotel.hotelID + '' === newHotel.hotelID + '') {\n modified = true;\n\n const hotelDetails: InitialHotelDetailsEventPayload = {\n name: newHotel.name,\n hotelID: newHotel.hotelID,\n hotelUrl: newHotel.hotelUrl,\n currency: newHotel.defaultCurrency,\n language: newHotel.defaultLanguage,\n address: newHotel.address,\n };\n\n const event = new InitialHotelDetailsEvent(hotelDetails);\n raise(event);\n\n if (callback) {\n return { ...callback(mappingHotel) };\n }\n\n return { ...newHotel };\n }\n\n return { ...mappingHotel };\n });\n\n if (!modified) {\n newHotelArray.push(newHotel);\n }\n\n return newHotelArray;\n });\n };\n\n const signUserIn = async (user: SignInUser) => {\n raise(new MemberOnlyFenceSignUp(memberOnlyModalPromotion as IPromotion));\n\n DataLayer.instance.sendMemberSignUp(); // Is this the right location for 'Signup' event?\n workingContext.closeMemberSignupModal();\n\n await beContext.sessionProvider.updateSession({ user: user, memberId: user.memberNumber });\n\n setSignedInUser(user);\n setMemberNumber(user.memberNumber);\n\n if (user.saveState) {\n await beContext.storageProvider.setUser(user);\n }\n };\n\n const signUserOut = async () => {\n await beContext.sessionProvider.updateSession({ user: undefined, memberId: undefined });\n await beContext.storageProvider.setUser(undefined);\n setSignedInUser(null);\n setMemberNumber(undefined);\n };\n\n const getHotel = useCallback(\n (hotelId: string) =>\n new Promise<Hotel>(async (resolve, reject) => {\n const currentHotelVersion: Hotel = getHotelFromID(hotelId) as Hotel;\n const newHotel: Hotel = {\n ...currentHotelVersion,\n };\n\n let details: HotelDTO;\n\n try {\n details = await API.Hotel.fetchData(currentLanguage, newHotel);\n } catch (ex) {\n reject(ex);\n }\n\n updateHotel(newHotel, (updatedHotel) => {\n updatedHotel.name = details.name;\n updatedHotel.address = details.address;\n\n updatedHotel.latitude = Number(details.latitude);\n updatedHotel.longitude = Number(details.longitude);\n updatedHotel.phone = details.phone;\n\n updatedHotel.checkInTime = TimeHelper.convert24To12hr(details.checkInTime);\n updatedHotel.checkOutTime = TimeHelper.convert24To12hr(details.checkOutTime);\n\n updatedHotel.paymentCardTypes = details.paymentCardTypes;\n updatedHotel.description = details.description;\n updatedHotel.locationDescription = details.locationDescription;\n updatedHotel.policies = details.policies;\n\n updatedHotel.hotelServices = details.hotelServices;\n updatedHotel.businessServices = details.businessServices;\n updatedHotel.rooms = details.rooms;\n\n updatedHotel.hasLoadedDetails = true;\n updatedHotel.dataSource = details.dataSource;\n\n updatedHotel.defaultCurrency = details.currencyCode;\n updatedHotel.cardProcessor = details.cardProcessor;\n updatedHotel.paymentMethods = details.paymentMethods;\n updatedHotel.planpay = details.planpay;\n updatedHotel.hotelUrl = details.hotelUrl || updatedHotel.hotelUrl || '';\n updatedHotel.heroImage = details.heroImage || updatedHotel.heroImage || '';\n updatedHotel.images = details.images || [];\n\n updatedHotel.email = details.email;\n updatedHotel.roomGroups = details.roomGroups;\n updatedHotel.requireDeposit = details.requireDeposit;\n updatedHotel.enableCreditCardSurcharge = details.enableCreditCardSurcharge;\n updatedHotel.integrations = details.integrations;\n updatedHotel.availableCountries = details.availableCountries;\n updatedHotel.preventCancellation = details.preventCancellation;\n\n if (updatedHotel.dataSource === HotelDataSource.Roomstay) {\n if (details.logo) {\n updatedHotel.logo = details.logo;\n }\n\n if (details.colors) {\n updatedHotel.colors = details.colors as IHotelColorScheme;\n }\n\n if (details.distanceUnitType) {\n updatedHotel.distanceUnitType = details.distanceUnitType;\n }\n\n if (details.weekdayStartsOn) {\n updatedHotel.startsWeekOnDay = details.weekdayStartsOn;\n }\n\n if (details.crossSellHotelIds) {\n updatedHotel.crossSellHotelIds = details.crossSellHotelIds;\n }\n\n if (details.stateFieldConfiguration) {\n updatedHotel.stateFieldConfiguration = details.stateFieldConfiguration;\n }\n }\n\n if (currentHotelVersion?.maxAdults) {\n //using HotelSpec maxAdults from frontend\n updatedHotel.maxAdults = currentHotelVersion.maxAdults;\n }\n\n if (details.maxAdults !== undefined) {\n updatedHotel.maxAdults = details.maxAdults;\n }\n\n if (details.maxChildren !== undefined) {\n updatedHotel.maxChildren = details.maxChildren;\n }\n\n if (details.maxInfants !== undefined) {\n updatedHotel.maxInfants = details.maxInfants;\n }\n\n if (details.rooms) {\n //dymanic maxOccupancy from rooms database\n const roomArray = Object.values(details.rooms);\n if (roomArray.length) {\n updatedHotel.maxOccupancy = roomArray.reduce((previousMax, current) => {\n return Math.max(previousMax, current.maxOccupancy);\n }, 0);\n }\n }\n\n updatedHotel.childConfiguration = details.childConfiguration;\n\n /**\n * Prioritized perks from roomstay-clients than roomstay-admin\n */\n updatedHotel.perks = updatedHotel.perks?.length ? updatedHotel.perks : details.perks;\n updatedHotel.perkTitle = updatedHotel.perkTitle ?? details.perkTitle;\n\n updatedHotel.countryPrefix = details.countryPrefix ?? updatedHotel.countryPrefix ?? '';\n updatedHotel.quoteImageDesktop = details.quoteImageDesktop ?? updatedHotel.quoteImageDesktop ?? '';\n updatedHotel.quoteImageMobile = details.quoteImageMobile ?? updatedHotel.quoteImageMobile ?? '';\n updatedHotel.memberOnlyImage = details.memberOnlyImage ?? updatedHotel.memberOnlyImage ?? '';\n if (details.memberOnlyRenderRateLast !== undefined) {\n updatedHotel.memberOnlyRenderRateLast = details.memberOnlyRenderRateLast;\n }\n updatedHotel.captureChildAge = details.captureChildAge;\n\n resolve(updatedHotel);\n return updatedHotel;\n });\n }),\n []\n );\n\n useEffect(() => {\n setName(company.name);\n setCompanyShort(company.companyShort);\n setLogo(company.logo);\n setColors(company.colors);\n setLogoLink(company.logoLink);\n setBrandSuffix(company.brandSuffix);\n\n DataLayer.instance.setBrandSuffix(company.brandSuffix);\n\n const configHotels = company.hotels.map((hotel: ConfigHotel) => {\n return { ...hotel, hasLoadedDetails: false, hotelID: `${hotel.hotelID}` } as Hotel;\n });\n setHotels(configHotels);\n\n if (company.selectedHotel) {\n const hotelId = typeof company.selectedHotel === 'string' ? company.selectedHotel : company.selectedHotel.hotelID + '';\n const targetHotel: ConfigHotel | undefined = getHotelFromArrayWithId(hotelId, configHotels);\n if (targetHotel) {\n setSelectedHotelID(hotelId);\n } else {\n // TODO: add centralized error logging\n console.log(`Unable to set selected hotel automatically. No Hotel found with ID: ${company.selectedHotel}`);\n }\n } else {\n /*\n We need to check if for some reason HotelStep isn't set as the first step,\n to automatically select a hotel, so engine doesn't fall over\n\n Possible TODO: We might need to do this on a new Step level, instead of here, as dynamically checking if StepHotel\n is first is probably not a great idea...\n */\n\n if (StepManager.getFirstStep() !== StepHotel) {\n setSelectedHotelID(configHotels[0].hotelID);\n console.log(`No selected hotel found - defaulting to ${configHotels[0].name}`);\n }\n }\n }, [company]);\n\n const onSelectedHotelIDChanged = React.useCallback(async () => {\n if (selectedHotelID) {\n const selectedHotel = await getHotel(selectedHotelID);\n\n if (selectedHotel) {\n currencyHelper.loadExchangeRates(selectedHotel.defaultCurrency ?? 'AUD');\n\n StaticContextProvider.MemberOnlyRateCodes = selectedHotel.memberOnlyRates ?? [];\n\n DataLayer.instance.setProviderHotelID(selectedHotel.providerHotelID);\n DataLayer.instance.setHotelName(selectedHotel.name);\n\n if (selectedHotel.datalayer?.gtmIds.length) {\n DataLayer.initialiseGTM(selectedHotel);\n }\n\n // Prep session based storage\n const sessionProvider = beContext.engine.getSessionProvider();\n await sessionProvider.setHotelID(selectedHotelID);\n\n // Prep local storage (non-session based)\n beContext.storageProvider.setHotelId(selectedHotelID);\n\n // Reload current user?\n const user = await beContext.storageProvider.getUser();\n\n if (user) {\n await signUserIn(user);\n }\n\n setCurrentCurrency(selectedHotel.defaultCurrency);\n\n selectedHotel?.onLoad?.();\n }\n } else {\n DataLayer.instance.setProviderHotelID('');\n DataLayer.instance.setHotelName(name);\n if (company?.datalayer?.gtmIds.length) {\n DataLayer.initialiseGTM(company);\n }\n }\n }, [selectedHotelID]);\n\n useEffect(() => {\n onSelectedHotelIDChanged();\n }, [onSelectedHotelIDChanged]);\n\n useEffect(() => {\n const selectedHotel = getSelectedHotel();\n\n DataLayer.instance.setCurrencyCodes(currentCurrency, selectedHotel?.defaultCurrency ?? currentCurrency);\n }, [currentCurrency, selectedHotelID]);\n\n // TODO: Add Hotel Details fetch\n // TODO: re-do fetch on language change\n\n const workingContext: CompanyContextType = {\n currentLanguage,\n currentCurrency,\n\n memberOnlyModalPromotion,\n\n name,\n companyShort,\n logo,\n logoLink,\n brandSuffix,\n\n colors,\n hotels,\n\n signedInUser,\n isSigningIn,\n\n selectedHotelID: selectedHotelID as string,\n\n updateLowestPricePerNight: (hotel: string | Hotel, row: BasketRow) => {\n const targetHotel = getHotelFromID(typeof hotel === 'string' ? hotel : hotel.hotelID + '');\n\n if (targetHotel && row) {\n const resetPriceToZero = (isLoading = false) => {\n updateHotel(targetHotel, (updatingHotel) => ({ ...updatingHotel, lowestPrice: { value: 0, isLoading } }));\n };\n\n resetPriceToZero(true);\n\n API.Availability.getCheapestPricePerDay(\n row.getStartDate(),\n row.getEndDate(),\n row.getAdults(),\n row.getChildren(),\n row.getInfants(),\n row.getPromoCode(),\n row.getRoomCode(),\n targetHotel.hotelID,\n memberNumber\n ).then((prices) => {\n let wasSet = false;\n if (prices) {\n let lowest = 0;\n const allPrices = Object.values(prices);\n if (allPrices?.length > 0) {\n lowest = Object.values(prices).reduce((prevValue, newValue) => (prevValue > newValue ? newValue : prevValue));\n\n wasSet = true;\n updateHotel(targetHotel, (updatingHotel) => ({ ...updatingHotel, lowestPrice: { value: lowest, isLoading: false } }));\n }\n }\n\n if (!wasSet) {\n resetPriceToZero();\n }\n });\n }\n },\n\n changeHotel: (hotel: string | Hotel) => {\n const targetHotel = getHotelFromID(typeof hotel === 'string' ? hotel : hotel.hotelID + '');\n\n if (targetHotel) {\n setSelectedHotelID(targetHotel.hotelID);\n return true;\n } else {\n // TODO: add centralized error logging\n console.log(`Unable to set selected hotel automatically. No Hotel found with ID: ${company.selectedHotel}`);\n return false;\n }\n },\n\n closeMemberSignupModal: () => {\n setIsSigningIn(false);\n setMemberOnlyModalPromotion(null);\n },\n openMemberSignupModal: (promotion?: IPromotion) => {\n setIsSigningIn(true);\n\n if (promotion) {\n setMemberOnlyModalPromotion(promotion);\n }\n },\n\n signUserIn,\n signUserOut,\n\n setCurrentCurrency,\n setCurrentLanguage,\n\n getHotel,\n externalMemberType,\n isExternalMemberHotel,\n memberNumber: memberNumber,\n selectedHotel,\n };\n\n return <CompanyContext.Provider value={workingContext}>{children}</CompanyContext.Provider>;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"CompanyContextWrapper.js","sourceRoot":"/","sources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;AAChG,CAAC,CAAC;AAxdW,QAAA,qBAAqB,yBAwdhC","sourcesContent":["import { BookingEngineContext, CompanyContext, CompanyContextType, SignInUser } from '@frontend/contexts';\nimport { InitialHotelDetailsEvent } from '@frontend/events';\nimport { useEvent } from '@frontend/hooks';\nimport { EIntegration, IHotelColorScheme } from '@roomstay/core';\nimport React, { ReactChild, useCallback, useContext, useEffect, useMemo, useState } from 'react';\n\nimport API from '@/api/BookingAPI';\nimport { MemberOnlyFenceSignUp } from '@/events/actions/MemberOnlyFence/MemberOnlyFenceSignUp';\nimport { HotelDTO } from '@/models/Api/HotelDTO';\nimport BasketRow from '@/models/BasketRow';\nimport type { ConfigCompany } from '@/models/Client/Hotel/Company';\nimport type { ConfigHotel, Hotel, InitialHotelDetailsEventPayload } from '@/models/Client/Hotel/Hotel';\nimport { HotelDataSource } from '@/models/Client/Hotel/HotelDataSource.types';\nimport { IPromotion } from '@/models/Promotion/IPromotion.type';\nimport StepHotel from '@/pages/steps/StepHotel/StepHotel';\nimport { Language } from '@/providers/LanguageProvider';\nimport StaticContextProvider from '@/providers/StaticContextProvider';\nimport * as currencyHelper from '@/util/CurrencyHelper';\nimport DataLayer from '@/util/DataLayer';\nimport StepManager from '@/util/StepManager';\nimport TimeHelper from '@/util/TimeHelper';\n\ninterface CompanyContextWrapperProps {\n children: ReactChild;\n configCompany: ConfigCompany;\n}\n\nexport const CompanyContextWrapper = ({ configCompany: company, children }: CompanyContextWrapperProps) => {\n const beContext = useContext(BookingEngineContext);\n\n const getSelectedHotel = () => {\n for (const hotel of hotels) {\n if (selectedHotelID + '' === hotel.hotelID + '') {\n return hotel;\n }\n }\n };\n\n const [name, setName] = useState(company.name);\n const [companyShort, setCompanyShort] = useState(company.companyShort);\n const [logo, setLogo] = useState(company.logo);\n const [colors, setColors] = useState(company.colors);\n const [hotels, setHotels] = useState<Hotel[]>(company.hotels as Hotel[]);\n const [logoLink, setLogoLink] = useState(company.logoLink);\n const [brandSuffix, setBrandSuffix] = useState(company.brandSuffix);\n\n const [selectedHotelID, setSelectedHotelID] = useState<string>();\n\n const selectedHotel = useMemo(() => {\n for (const companyHotel of hotels) {\n if (selectedHotelID + '' === companyHotel.hotelID + '') {\n return companyHotel;\n }\n }\n }, [hotels, selectedHotelID]);\n\n const [currentCurrency, setCurrentCurrency] = useState<string>(getSelectedHotel()?.defaultCurrency ?? 'AUD');\n const [currentLanguage, setCurrentLanguage] = useState<Language>(getSelectedHotel()?.defaultLanguage ?? Language.en_us);\n\n const [memberOnlyModalPromotion, setMemberOnlyModalPromotion] = useState<IPromotion | null>(null);\n\n const [signedInUser, setSignedInUser] = useState<SignInUser | null>(null);\n const [isSigningIn, setIsSigningIn] = useState(false);\n\n const [memberNumber, setMemberNumber] = useState<string>();\n const [isExternalMemberHotel, setIsExternalMemberHotel] = useState<boolean>(false);\n\n const externalMemberType = useMemo(() => {\n const integrations = selectedHotel?.integrations;\n\n // Because integrations is an array of strings technically both Big4 and Top10 theoretically come down, so we'll choose one\n if (integrations?.includes(EIntegration.Big4)) {\n return EIntegration.Big4;\n } else if (integrations?.includes(EIntegration.Top10)) {\n return EIntegration.Top10;\n } else if (integrations?.includes(EIntegration.RmsTop10)) {\n return EIntegration.RmsTop10;\n } else if (integrations?.includes(EIntegration.Gday)) {\n return EIntegration.Gday;\n } else if (integrations?.includes(EIntegration.Salesforce)) {\n return EIntegration.Salesforce;\n }\n }, [selectedHotel]);\n\n useEffect(() => {\n const isExternalProvider =\n selectedHotel?.integrations?.some(\n (provider) =>\n provider === EIntegration.Big4 ||\n provider === EIntegration.Top10 ||\n provider === EIntegration.RmsTop10 ||\n provider === EIntegration.Gday ||\n provider === EIntegration.Salesforce\n ) || false;\n setIsExternalMemberHotel(isExternalProvider);\n }, [selectedHotel]);\n\n const { raise } = useEvent();\n\n const getHotelFromArrayWithId = (id: string, arrayOfHotels: Hotel[] | ConfigHotel[]) => {\n for (const nextHotel of arrayOfHotels) {\n if (nextHotel.hotelID + '' === id + '') {\n return nextHotel;\n }\n }\n };\n const getHotelFromID = (id: string): Hotel => {\n return getHotelFromArrayWithId(id, hotels) as Hotel;\n };\n\n const updateHotel = (newHotel: Hotel, callback?: (hotel: Hotel) => Hotel) => {\n setHotels((oldHotels) => {\n let modified = false;\n const newHotelArray = oldHotels.map((mappingHotel) => {\n if (mappingHotel.hotelID + '' === newHotel.hotelID + '') {\n modified = true;\n\n const hotelDetails: InitialHotelDetailsEventPayload = {\n name: newHotel.name,\n hotelID: newHotel.hotelID,\n hotelUrl: newHotel.hotelUrl,\n currency: newHotel.defaultCurrency,\n language: newHotel.defaultLanguage,\n address: newHotel.address,\n };\n\n const event = new InitialHotelDetailsEvent(hotelDetails);\n raise(event);\n\n if (callback) {\n return { ...callback(mappingHotel) };\n }\n\n return { ...newHotel };\n }\n\n return { ...mappingHotel };\n });\n\n if (!modified) {\n newHotelArray.push(newHotel);\n }\n\n return newHotelArray;\n });\n };\n\n const signUserIn = async (user: SignInUser) => {\n raise(new MemberOnlyFenceSignUp(memberOnlyModalPromotion as IPromotion));\n\n DataLayer.instance.sendMemberSignUp(); // Is this the right location for 'Signup' event?\n workingContext.closeMemberSignupModal();\n\n await beContext.sessionProvider.updateSession({ user: user, memberId: user.memberNumber });\n\n setSignedInUser(user);\n setMemberNumber(user.memberNumber);\n\n if (user.saveState) {\n await beContext.storageProvider.setUser(user);\n }\n };\n\n const signUserOut = async () => {\n await beContext.sessionProvider.updateSession({ user: undefined, memberId: undefined });\n await beContext.storageProvider.setUser(undefined);\n setSignedInUser(null);\n setMemberNumber(undefined);\n };\n\n const getHotel = useCallback(\n (hotelId: string) =>\n new Promise<Hotel>(async (resolve, reject) => {\n const currentHotelVersion: Hotel = getHotelFromID(hotelId) as Hotel;\n const newHotel: Hotel = {\n ...currentHotelVersion,\n };\n\n let details: HotelDTO;\n\n try {\n details = await API.Hotel.fetchData(currentLanguage, newHotel);\n } catch (ex) {\n reject(ex);\n }\n\n updateHotel(newHotel, (updatedHotel) => {\n updatedHotel.name = details.name;\n updatedHotel.address = details.address;\n\n updatedHotel.latitude = Number(details.latitude);\n updatedHotel.longitude = Number(details.longitude);\n updatedHotel.phone = details.phone;\n\n updatedHotel.checkInTime = TimeHelper.convert24To12hr(details.checkInTime);\n updatedHotel.checkOutTime = TimeHelper.convert24To12hr(details.checkOutTime);\n\n updatedHotel.paymentCardTypes = details.paymentCardTypes;\n updatedHotel.description = details.description;\n updatedHotel.locationDescription = details.locationDescription;\n updatedHotel.policies = details.policies;\n\n updatedHotel.hotelServices = details.hotelServices;\n updatedHotel.businessServices = details.businessServices;\n updatedHotel.rooms = details.rooms;\n\n updatedHotel.hasLoadedDetails = true;\n updatedHotel.dataSource = details.dataSource;\n\n updatedHotel.defaultCurrency = details.currencyCode;\n updatedHotel.cardProcessor = details.cardProcessor;\n updatedHotel.paymentMethods = details.paymentMethods;\n updatedHotel.planpay = details.planpay;\n updatedHotel.hotelUrl = details.hotelUrl || updatedHotel.hotelUrl || '';\n updatedHotel.heroImage = details.heroImage || updatedHotel.heroImage || '';\n updatedHotel.images = details.images || [];\n\n updatedHotel.email = details.email;\n updatedHotel.roomGroups = details.roomGroups;\n updatedHotel.requireDeposit = details.requireDeposit;\n updatedHotel.enableCreditCardSurcharge = details.enableCreditCardSurcharge;\n updatedHotel.integrations = details.integrations;\n updatedHotel.availableCountries = details.availableCountries;\n updatedHotel.preventCancellation = details.preventCancellation;\n\n if (updatedHotel.dataSource === HotelDataSource.Roomstay) {\n if (details.logo) {\n updatedHotel.logo = details.logo;\n }\n\n if (details.colors) {\n updatedHotel.colors = details.colors as IHotelColorScheme;\n }\n\n if (details.distanceUnitType) {\n updatedHotel.distanceUnitType = details.distanceUnitType;\n }\n\n if (details.weekdayStartsOn) {\n updatedHotel.startsWeekOnDay = details.weekdayStartsOn;\n }\n\n if (details.crossSellHotelIds) {\n updatedHotel.crossSellHotelIds = details.crossSellHotelIds;\n }\n\n if (details.stateFieldConfiguration) {\n updatedHotel.stateFieldConfiguration = details.stateFieldConfiguration;\n }\n }\n\n if (currentHotelVersion?.maxAdults) {\n //using HotelSpec maxAdults from frontend\n updatedHotel.maxAdults = currentHotelVersion.maxAdults;\n }\n\n if (details.maxAdults !== undefined) {\n updatedHotel.maxAdults = details.maxAdults;\n }\n\n if (details.maxChildren !== undefined) {\n updatedHotel.maxChildren = details.maxChildren;\n }\n\n if (details.maxInfants !== undefined) {\n updatedHotel.maxInfants = details.maxInfants;\n }\n\n if (details.rooms) {\n //dymanic maxOccupancy from rooms database\n const roomArray = Object.values(details.rooms);\n if (roomArray.length) {\n updatedHotel.maxOccupancy = roomArray.reduce((previousMax, current) => {\n return Math.max(previousMax, current.maxOccupancy);\n }, 0);\n }\n }\n\n updatedHotel.childConfiguration = details.childConfiguration;\n\n /**\n * Prioritized perks from roomstay-clients than roomstay-admin\n */\n updatedHotel.perks = updatedHotel.perks?.length ? updatedHotel.perks : details.perks;\n updatedHotel.perkTitle = updatedHotel.perkTitle ?? details.perkTitle;\n\n updatedHotel.countryPrefix = details.countryPrefix ?? updatedHotel.countryPrefix ?? '';\n updatedHotel.quoteImageDesktop = details.quoteImageDesktop ?? updatedHotel.quoteImageDesktop ?? '';\n updatedHotel.quoteImageMobile = details.quoteImageMobile ?? updatedHotel.quoteImageMobile ?? '';\n updatedHotel.memberOnlyImage = details.memberOnlyImage ?? updatedHotel.memberOnlyImage ?? '';\n if (details.memberOnlyRenderRateLast !== undefined) {\n updatedHotel.memberOnlyRenderRateLast = details.memberOnlyRenderRateLast;\n }\n updatedHotel.captureChildAge = details.captureChildAge;\n\n updatedHotel.company = details.company;\n\n resolve(updatedHotel);\n return updatedHotel;\n });\n }),\n []\n );\n\n useEffect(() => {\n setName(company.name);\n setCompanyShort(company.companyShort);\n setLogo(company.logo);\n setColors(company.colors);\n setLogoLink(company.logoLink);\n setBrandSuffix(company.brandSuffix);\n\n DataLayer.instance.setBrandSuffix(company.brandSuffix);\n\n const configHotels = company.hotels.map((hotel: ConfigHotel) => {\n return { ...hotel, hasLoadedDetails: false, hotelID: `${hotel.hotelID}` } as Hotel;\n });\n setHotels(configHotels);\n\n if (company.selectedHotel) {\n const hotelId = typeof company.selectedHotel === 'string' ? company.selectedHotel : company.selectedHotel.hotelID + '';\n const targetHotel: ConfigHotel | undefined = getHotelFromArrayWithId(hotelId, configHotels);\n if (targetHotel) {\n setSelectedHotelID(hotelId);\n } else {\n // TODO: add centralized error logging\n console.log(`Unable to set selected hotel automatically. No Hotel found with ID: ${company.selectedHotel}`);\n }\n } else {\n /*\n We need to check if for some reason HotelStep isn't set as the first step,\n to automatically select a hotel, so engine doesn't fall over\n\n Possible TODO: We might need to do this on a new Step level, instead of here, as dynamically checking if StepHotel\n is first is probably not a great idea...\n */\n\n if (StepManager.getFirstStep() !== StepHotel) {\n setSelectedHotelID(configHotels[0].hotelID);\n console.log(`No selected hotel found - defaulting to ${configHotels[0].name}`);\n }\n }\n }, [company]);\n\n const onSelectedHotelIDChanged = React.useCallback(async () => {\n if (selectedHotelID) {\n const selectedHotel = await getHotel(selectedHotelID);\n\n if (selectedHotel) {\n currencyHelper.loadExchangeRates(selectedHotel.defaultCurrency ?? 'AUD');\n\n StaticContextProvider.MemberOnlyRateCodes = selectedHotel.memberOnlyRates ?? [];\n\n DataLayer.instance.setProviderHotelID(selectedHotel.providerHotelID);\n DataLayer.instance.setHotelName(selectedHotel.name);\n\n if (selectedHotel.datalayer?.gtmIds.length) {\n DataLayer.initialiseGTM(selectedHotel);\n }\n\n // Prep session based storage\n const sessionProvider = beContext.engine.getSessionProvider();\n await sessionProvider.setHotelID(selectedHotelID);\n\n // Prep local storage (non-session based)\n beContext.storageProvider.setHotelId(selectedHotelID);\n\n // Reload current user?\n const user = await beContext.storageProvider.getUser();\n\n if (user) {\n await signUserIn(user);\n }\n\n setCurrentCurrency(selectedHotel.defaultCurrency);\n\n selectedHotel?.onLoad?.();\n }\n } else {\n DataLayer.instance.setProviderHotelID('');\n DataLayer.instance.setHotelName(name);\n if (company?.datalayer?.gtmIds.length) {\n DataLayer.initialiseGTM(company);\n }\n }\n }, [selectedHotelID]);\n\n useEffect(() => {\n onSelectedHotelIDChanged();\n }, [onSelectedHotelIDChanged]);\n\n useEffect(() => {\n const selectedHotel = getSelectedHotel();\n\n DataLayer.instance.setCurrencyCodes(currentCurrency, selectedHotel?.defaultCurrency ?? currentCurrency);\n }, [currentCurrency, selectedHotelID]);\n\n // TODO: Add Hotel Details fetch\n // TODO: re-do fetch on language change\n\n const workingContext: CompanyContextType = {\n currentLanguage,\n currentCurrency,\n\n memberOnlyModalPromotion,\n\n name,\n companyShort,\n logo,\n logoLink,\n brandSuffix,\n\n colors,\n hotels,\n\n signedInUser,\n isSigningIn,\n\n selectedHotelID: selectedHotelID as string,\n\n updateLowestPricePerNight: (hotel: string | Hotel, row: BasketRow) => {\n const targetHotel = getHotelFromID(typeof hotel === 'string' ? hotel : hotel.hotelID + '');\n\n if (targetHotel && row) {\n const resetPriceToZero = (isLoading = false) => {\n updateHotel(targetHotel, (updatingHotel) => ({ ...updatingHotel, lowestPrice: { value: 0, isLoading } }));\n };\n\n resetPriceToZero(true);\n\n API.Availability.getCheapestPricePerDay(\n row.getStartDate(),\n row.getEndDate(),\n row.getAdults(),\n row.getChildren(),\n row.getInfants(),\n row.getPromoCode(),\n row.getRoomCode(),\n targetHotel.hotelID,\n memberNumber\n ).then((prices) => {\n let wasSet = false;\n if (prices) {\n let lowest = 0;\n const allPrices = Object.values(prices);\n if (allPrices?.length > 0) {\n lowest = Object.values(prices).reduce((prevValue, newValue) => (prevValue > newValue ? newValue : prevValue));\n\n wasSet = true;\n updateHotel(targetHotel, (updatingHotel) => ({ ...updatingHotel, lowestPrice: { value: lowest, isLoading: false } }));\n }\n }\n\n if (!wasSet) {\n resetPriceToZero();\n }\n });\n }\n },\n\n changeHotel: (hotel: string | Hotel) => {\n const targetHotel = getHotelFromID(typeof hotel === 'string' ? hotel : hotel.hotelID + '');\n\n if (targetHotel) {\n setSelectedHotelID(targetHotel.hotelID);\n return true;\n } else {\n // TODO: add centralized error logging\n console.log(`Unable to set selected hotel automatically. No Hotel found with ID: ${company.selectedHotel}`);\n return false;\n }\n },\n\n closeMemberSignupModal: () => {\n setIsSigningIn(false);\n setMemberOnlyModalPromotion(null);\n },\n openMemberSignupModal: (promotion?: IPromotion) => {\n setIsSigningIn(true);\n\n if (promotion) {\n setMemberOnlyModalPromotion(promotion);\n }\n },\n\n signUserIn,\n signUserOut,\n\n setCurrentCurrency,\n setCurrentLanguage,\n\n getHotel,\n externalMemberType,\n isExternalMemberHotel,\n memberNumber: memberNumber,\n selectedHotel,\n };\n\n return <CompanyContext.Provider value={workingContext}>{children}</CompanyContext.Provider>;\n};\n"]}
|
|
@@ -107,7 +107,7 @@ export type HotelDTO = {
|
|
|
107
107
|
maxChildren?: number;
|
|
108
108
|
maxInfants?: number;
|
|
109
109
|
stateFieldConfiguration?: EHotelStateFieldConfiguration;
|
|
110
|
-
} & Pick<AdminHotelConfig, 'childConfiguration' | 'perks' | 'perkTitle' | 'countryPrefix' | 'quoteImageDesktop' | 'quoteImageMobile' | 'memberOnlyImage' | 'captureChildAge'> & Pick<ClientHotelConfig, 'memberOnlyRenderRateLast'>;
|
|
110
|
+
} & Pick<AdminHotelConfig, 'childConfiguration' | 'perks' | 'perkTitle' | 'countryPrefix' | 'quoteImageDesktop' | 'quoteImageMobile' | 'memberOnlyImage' | 'captureChildAge' | 'company'> & Pick<ClientHotelConfig, 'memberOnlyRenderRateLast'>;
|
|
111
111
|
export declare enum VGSCardName {
|
|
112
112
|
Visa = "visa",
|
|
113
113
|
Mastercard = "mastercard",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotelDTO.js","sourceRoot":"/","sources":["src/models/Api/HotelDTO.ts"],"names":[],"mappings":";;;AAMA,uDAAiH;
|
|
1
|
+
{"version":3,"file":"HotelDTO.js","sourceRoot":"/","sources":["src/models/Api/HotelDTO.ts"],"names":[],"mappings":";;;AAMA,uDAAiH;AA4HjH,IAAY,WAOX;AAPD,WAAY,WAAW;IACnB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,0BAAW,CAAA;IACX,wCAAyB,CAAA;IACzB,uCAAwB,CAAA;IACxB,oCAAqB,CAAA;AACzB,CAAC,EAPW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAOtB;AAEY,QAAA,0BAA0B,GAAsD;IACzF,CAAC,wBAAgB,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,IAAI;IACzC,CAAC,wBAAgB,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,UAAU;IACrD,CAAC,wBAAgB,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG;IACvC,CAAC,wBAAgB,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC,eAAe;IAC/D,CAAC,wBAAgB,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,UAAU;IACrD,CAAC,wBAAgB,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,QAAQ;CACpD,CAAC","sourcesContent":["import type { EnvironmentName } from '@planpay/web';\nimport type { EBookingPaymentMethod, EHotelCardProcessor, EHotelStateFieldConfiguration, EIntegration, IAuxiliaryFilter } from '@roomstay/core';\nimport { DeepPartial } from 'react-hook-form';\n\nimport ColorProfile from '@/models/Client/Hotel/ColorProfile';\nimport { DistanceUnitType } from '@/models/Client/Hotel/DistanceUnitType.types';\nimport { AdminHotelConfig, ClientHotelConfig, ConfigHotel, EPaymentCardType } from '@/models/Client/Hotel/Hotel';\nimport HotelAddress from '@/models/Client/Hotel/HotelAddress';\nimport { HotelDataSource } from '@/models/Client/Hotel/HotelDataSource.types';\nimport { WeekdayStartsOn } from '@/models/Client/Hotel/WeekdayStartsOn.types';\n\nexport type HotelServiceDTO = {\n detail: string;\n included: boolean;\n name: string;\n onsite: boolean;\n};\n\nexport type HotelRoomsDTO = {\n [roomTypeCode: string]: HotelRoomDTO;\n};\n\nexport type HotelRoomGroupsDTO = {\n groupName: string;\n id: string;\n filters: {\n [id: string]: {\n name: string;\n type: 'select';\n includeAllAbove: boolean;\n requireInput: boolean;\n options: IAuxiliaryFilter['options'];\n };\n };\n}[];\n\nexport type HotelRoomAmenitiesDTO = {\n type: string;\n description: string;\n};\n\nexport type HotelRoomDTO = {\n code: string;\n name: string;\n shortDescription: string;\n longDescription: string;\n images: string[];\n quantity: number;\n maxOccupancy: number;\n bedQuantity: number;\n showBedType?: boolean;\n standardNumBeds: number;\n maxRollaways: number;\n bedType: string;\n amenities: HotelRoomAmenitiesDTO[];\n features: HotelRoomAmenitiesDTO[];\n bedTypeOverride?: string;\n roomGroupId?: string;\n roomSize?: number;\n prePerkDisclaimer?: string;\n perks?: ConfigHotel['perks'];\n};\n\nexport type HotelDTO = {\n id: number;\n name: string;\n chainId: number;\n chainName: string;\n\n address: HotelAddress;\n phone: string;\n\n latitude: string;\n longitude: string;\n\n utcOffset: string;\n\n languageCode: string;\n currencyCode: string;\n\n checkInTime: string;\n checkOutTime: string;\n\n paymentCardTypes: EPaymentCardType[];\n\n description: string;\n locationDescription: string;\n policies: string;\n\n hotelServices: HotelServiceDTO[];\n businessServices: HotelServiceDTO[];\n\n rooms: { [roomTypeCode: string]: HotelRoomDTO };\n dataSource: HotelDataSource;\n\n // Following fields are only present if dataSource = 'roomstay'\n logo?: string;\n colors: DeepPartial<ColorProfile>;\n distanceUnitType?: DistanceUnitType;\n weekdayStartsOn?: WeekdayStartsOn;\n\n crossSellHotelIds?: string[];\n paymentMethods: EBookingPaymentMethod[];\n cardProcessor: EHotelCardProcessor;\n planpay?: {\n username: string;\n minDaysShowPlanpay: number;\n env: EnvironmentName;\n };\n\n email?: string;\n hotelUrl?: string;\n heroImage?: string;\n images?: string[];\n integrations?: EIntegration[];\n roomGroups: HotelRoomGroupsDTO;\n requireDeposit?: boolean;\n enableCreditCardSurcharge?: boolean;\n availableCountries?: { name: string; value: string }[];\n preventCancellation?: boolean;\n maxAdults?: number;\n maxChildren?: number;\n maxInfants?: number;\n stateFieldConfiguration?: EHotelStateFieldConfiguration;\n} & Pick<\n AdminHotelConfig,\n 'childConfiguration' | 'perks' | 'perkTitle' | 'countryPrefix' | 'quoteImageDesktop' | 'quoteImageMobile' | 'memberOnlyImage' | 'captureChildAge' | 'company'\n> &\n Pick<ClientHotelConfig, 'memberOnlyRenderRateLast'>;\n\nexport enum VGSCardName {\n Visa = 'visa',\n Mastercard = 'mastercard',\n JCB = 'jcb',\n DinersClub = 'dinersclub',\n AmericanExpress = 'amex',\n UnionPay = 'unionpay',\n}\n\nexport const SynxisToVGSCardNameMapping: { [synxisName in EPaymentCardType]: VGSCardName } = {\n [EPaymentCardType.Visa]: VGSCardName.Visa,\n [EPaymentCardType.Mastercard]: VGSCardName.Mastercard,\n [EPaymentCardType.JCB]: VGSCardName.JCB,\n [EPaymentCardType.AmericanExpress]: VGSCardName.AmericanExpress,\n [EPaymentCardType.DinersClub]: VGSCardName.DinersClub,\n [EPaymentCardType.UnionPay]: VGSCardName.UnionPay,\n};\n"]}
|
|
@@ -100,6 +100,10 @@ export interface AdminHotelConfig {
|
|
|
100
100
|
quoteImageMobile?: string;
|
|
101
101
|
memberOnlyImage?: string;
|
|
102
102
|
captureChildAge?: boolean;
|
|
103
|
+
company: {
|
|
104
|
+
url?: string;
|
|
105
|
+
logo?: string;
|
|
106
|
+
};
|
|
103
107
|
}
|
|
104
108
|
/**
|
|
105
109
|
* This config comes from hard static local file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hotel.js","sourceRoot":"/","sources":["src/models/Client/Hotel/Hotel.ts"],"names":[],"mappings":";;;AAkBA,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IACxB,+BAAW,CAAA;IACX,qCAAiB,CAAA;IACjB,8BAAU,CAAA;IACV,0CAAsB,CAAA;IACtB,qCAAiB,CAAA;IACjB,mCAAe,CAAA;AACnB,CAAC,EAPW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAO3B","sourcesContent":["import type { EnvironmentName } from '@planpay/web';\nimport { EBookingPaymentMethod, EHotelCardProcessor, EHotelStateFieldConfiguration, EIntegration, IHotelColorScheme } from '@roomstay/core';\nimport { Property } from 'csstype';\nimport type { ReactChild } from 'react';\n\nimport type { InternalMemberSignInInputs } from '@/components/members/SignInModal/InternalMemberSignInModal.types';\nimport type { HotelRoomGroupsDTO, HotelRoomsDTO, HotelServiceDTO } from '@/models/Api/HotelDTO';\nimport type { TransportDistances } from '@/models/Api/HotelOverrideDTO';\nimport type { HasDatalayerTags } from '@/models/Client/Hotel/Company';\nimport type { DistanceUnitType } from '@/models/Client/Hotel/DistanceUnitType.types';\nimport type HotelAddress from '@/models/Client/Hotel/HotelAddress';\nimport type { HotelDataSource } from '@/models/Client/Hotel/HotelDataSource.types';\nimport type { HotelPerk } from '@/models/Client/Hotel/HotelPerk';\nimport type { HotelRoomOverwrite } from '@/models/Client/Hotel/HotelRoomOverwrite';\nimport type { WeekdayStartsOn } from '@/models/Client/Hotel/WeekdayStartsOn.types';\nimport type { Language } from '@/providers/LanguageProvider';\nimport { RoomSort } from '@/providers/RoomSortProvider';\n\nexport enum EPaymentCardType {\n Visa = 'VI',\n Mastercard = 'MC',\n JCB = 'JC',\n AmericanExpress = 'AX',\n DinersClub = 'DN',\n UnionPay = 'UP',\n}\n\nexport interface IVGSVaultNames {\n standard: string;\n members: string;\n}\n\n/**\n * This config comes from admin\n */\nexport interface AdminHotelConfig {\n hotelID: string;\n name: string;\n address?: HotelAddress;\n latitude?: number;\n longitude?: number;\n phone?: string;\n email?: string;\n checkInTime?: string;\n checkOutTime?: string;\n paymentCardTypes?: EPaymentCardType[];\n description?: string;\n locationDescription?: string;\n policies?: string;\n hotelServices: HotelServiceDTO[];\n businessServices: HotelServiceDTO[];\n rooms: HotelRoomsDTO;\n hasLoadedDetails?: boolean;\n dataSource: HotelDataSource;\n defaultCurrency: string;\n paymentMethods: EBookingPaymentMethod[];\n planpay?: {\n username: string;\n minDaysShowPlanpay: number;\n env: EnvironmentName;\n };\n hotelUrl: string;\n heroImage: string;\n memberOnlyModalImage?: string;\n memberOnlyModalImageSize: Property.ObjectFit;\n images?: string[];\n logo: string | ReactChild;\n colors: IHotelColorScheme;\n distanceUnitType: DistanceUnitType;\n startsWeekOnDay?: WeekdayStartsOn;\n crossSellHotelIds?: string[];\n maxOccupancy?: number;\n maxAdults?: number;\n maxChildren?: number;\n maxInfants?: number;\n hideByLine?: boolean;\n transportDistances?: TransportDistances;\n roomGroups: HotelRoomGroupsDTO;\n cardProcessor: EHotelCardProcessor;\n\n requireDeposit?: boolean;\n enableCreditCardSurcharge?: boolean;\n availableCountries?: { name: string; value: string }[];\n\n childConfiguration?: {\n supportChildren?: boolean;\n supportInfants: boolean;\n childRange: { min: number; max: number };\n infantRange: { min: number; max: number };\n };\n preventCancellation?: boolean;\n\n perks?: HotelPerk[];\n perkTitle?: string;\n\n stateFieldConfiguration?: EHotelStateFieldConfiguration;\n\n countryPrefix?: string;\n quoteImageDesktop?: string;\n quoteImageMobile?: string;\n memberOnlyImage?: string;\n captureChildAge?: boolean;\n}\n\n/**\n * This config comes from hard static local file\n */\nexport interface ClientHotelConfig {\n providerHotelID: string;\n shortName?: string;\n defaultDatepickerType?: 'Month' | 'Week';\n // TODO: need to do magic to see if we need to append / prepend stuff, for now we assume that it's only used while on the site.\n checkoutUrl?: string;\n defaultLanguage: Language;\n privacyPolicyUrl: string;\n bookNowPayLaterUrl?: string;\n bestRateNoBSUrl?: string;\n\n memberOnlyRates?: string[];\n memberOnlyPromoCode?: string;\n memberOnlyRenderRateLast?: boolean;\n memberOnlySignupInputs?: InternalMemberSignInInputs;\n googleMapsImage?: string;\n /**\n * Whether to show the Breakfast / Lunch / Dinner included\n */\n showMealPill?: boolean;\n perks?: HotelPerk[];\n perkTitle?: string;\n /**\n * Hide perks on room row\n */\n perksHideOnRoomRow?: boolean;\n /**\n * Hide perks on room detail modal\n */\n perksHideOnRoomDetail?: boolean;\n perksShowDisclaimer?: boolean;\n /** @deprecated Use the vgs.vaultNames.standard property now */\n vgsVaultName?: string;\n vgs?: {\n vaultNames: IVGSVaultNames;\n };\n showAddonLoader: boolean;\n overwrites?: { [code: string]: Partial<HotelRoomOverwrite> };\n forwardFindReservationToSynxis?: boolean;\n additionalOptions?: { [name: string]: any };\n googleReCaptcha?: {\n loadForMembers?: boolean;\n siteKey?: string;\n };\n /**\n * Show description on RoomDetails\n */\n showDescriptionOnRoomDetails?: boolean;\n /**\n * Customize the Member modal colours. Specifically replacing the green (success) with the primary color of hotel (accent)\n */\n memberOnlyModalUsePrimaryColor?: boolean;\n /**\n * Callback to trigger specific events on load of a hotel.\n *\n * This is where you can specify custom fields, language overrides, feature toggles etc.\n */\n onLoad?: () => void;\n currentRoomSort?: RoomSort; //override default room sort\n maxAdults?: number; //fixed from frontend\n}\n\nexport interface ConfigHotel extends ClientHotelConfig, AdminHotelConfig, HasDatalayerTags {}\n\nexport type Hotel = ConfigHotel & {\n lowestPrice?: {\n value: number;\n isLoading: boolean;\n };\n integrations?: EIntegration[];\n};\n\n/**\n * Used for DetailsHotel event\n */\nexport type InitialHotelDetailsEventPayload = {\n name: string;\n hotelID: number | string;\n hotelUrl: string;\n currency: string;\n language: Language;\n address?: HotelAddress;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Hotel.js","sourceRoot":"/","sources":["src/models/Client/Hotel/Hotel.ts"],"names":[],"mappings":";;;AAkBA,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IACxB,+BAAW,CAAA;IACX,qCAAiB,CAAA;IACjB,8BAAU,CAAA;IACV,0CAAsB,CAAA;IACtB,qCAAiB,CAAA;IACjB,mCAAe,CAAA;AACnB,CAAC,EAPW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAO3B","sourcesContent":["import type { EnvironmentName } from '@planpay/web';\nimport { EBookingPaymentMethod, EHotelCardProcessor, EHotelStateFieldConfiguration, EIntegration, IHotelColorScheme } from '@roomstay/core';\nimport { Property } from 'csstype';\nimport type { ReactChild } from 'react';\n\nimport type { InternalMemberSignInInputs } from '@/components/members/SignInModal/InternalMemberSignInModal.types';\nimport type { HotelRoomGroupsDTO, HotelRoomsDTO, HotelServiceDTO } from '@/models/Api/HotelDTO';\nimport type { TransportDistances } from '@/models/Api/HotelOverrideDTO';\nimport type { HasDatalayerTags } from '@/models/Client/Hotel/Company';\nimport type { DistanceUnitType } from '@/models/Client/Hotel/DistanceUnitType.types';\nimport type HotelAddress from '@/models/Client/Hotel/HotelAddress';\nimport type { HotelDataSource } from '@/models/Client/Hotel/HotelDataSource.types';\nimport type { HotelPerk } from '@/models/Client/Hotel/HotelPerk';\nimport type { HotelRoomOverwrite } from '@/models/Client/Hotel/HotelRoomOverwrite';\nimport type { WeekdayStartsOn } from '@/models/Client/Hotel/WeekdayStartsOn.types';\nimport type { Language } from '@/providers/LanguageProvider';\nimport { RoomSort } from '@/providers/RoomSortProvider';\n\nexport enum EPaymentCardType {\n Visa = 'VI',\n Mastercard = 'MC',\n JCB = 'JC',\n AmericanExpress = 'AX',\n DinersClub = 'DN',\n UnionPay = 'UP',\n}\n\nexport interface IVGSVaultNames {\n standard: string;\n members: string;\n}\n\n/**\n * This config comes from admin\n */\nexport interface AdminHotelConfig {\n hotelID: string;\n name: string;\n address?: HotelAddress;\n latitude?: number;\n longitude?: number;\n phone?: string;\n email?: string;\n checkInTime?: string;\n checkOutTime?: string;\n paymentCardTypes?: EPaymentCardType[];\n description?: string;\n locationDescription?: string;\n policies?: string;\n hotelServices: HotelServiceDTO[];\n businessServices: HotelServiceDTO[];\n rooms: HotelRoomsDTO;\n hasLoadedDetails?: boolean;\n dataSource: HotelDataSource;\n defaultCurrency: string;\n paymentMethods: EBookingPaymentMethod[];\n planpay?: {\n username: string;\n minDaysShowPlanpay: number;\n env: EnvironmentName;\n };\n hotelUrl: string;\n heroImage: string;\n memberOnlyModalImage?: string;\n memberOnlyModalImageSize: Property.ObjectFit;\n images?: string[];\n logo: string | ReactChild;\n colors: IHotelColorScheme;\n distanceUnitType: DistanceUnitType;\n startsWeekOnDay?: WeekdayStartsOn;\n crossSellHotelIds?: string[];\n maxOccupancy?: number;\n maxAdults?: number;\n maxChildren?: number;\n maxInfants?: number;\n hideByLine?: boolean;\n transportDistances?: TransportDistances;\n roomGroups: HotelRoomGroupsDTO;\n cardProcessor: EHotelCardProcessor;\n\n requireDeposit?: boolean;\n enableCreditCardSurcharge?: boolean;\n availableCountries?: { name: string; value: string }[];\n\n childConfiguration?: {\n supportChildren?: boolean;\n supportInfants: boolean;\n childRange: { min: number; max: number };\n infantRange: { min: number; max: number };\n };\n preventCancellation?: boolean;\n\n perks?: HotelPerk[];\n perkTitle?: string;\n\n stateFieldConfiguration?: EHotelStateFieldConfiguration;\n\n countryPrefix?: string;\n quoteImageDesktop?: string;\n quoteImageMobile?: string;\n memberOnlyImage?: string;\n captureChildAge?: boolean;\n\n company: {\n url?: string;\n logo?: string;\n };\n}\n\n/**\n * This config comes from hard static local file\n */\nexport interface ClientHotelConfig {\n providerHotelID: string;\n shortName?: string;\n defaultDatepickerType?: 'Month' | 'Week';\n // TODO: need to do magic to see if we need to append / prepend stuff, for now we assume that it's only used while on the site.\n checkoutUrl?: string;\n defaultLanguage: Language;\n privacyPolicyUrl: string;\n bookNowPayLaterUrl?: string;\n bestRateNoBSUrl?: string;\n\n memberOnlyRates?: string[];\n memberOnlyPromoCode?: string;\n memberOnlyRenderRateLast?: boolean;\n memberOnlySignupInputs?: InternalMemberSignInInputs;\n googleMapsImage?: string;\n /**\n * Whether to show the Breakfast / Lunch / Dinner included\n */\n showMealPill?: boolean;\n perks?: HotelPerk[];\n perkTitle?: string;\n /**\n * Hide perks on room row\n */\n perksHideOnRoomRow?: boolean;\n /**\n * Hide perks on room detail modal\n */\n perksHideOnRoomDetail?: boolean;\n perksShowDisclaimer?: boolean;\n /** @deprecated Use the vgs.vaultNames.standard property now */\n vgsVaultName?: string;\n vgs?: {\n vaultNames: IVGSVaultNames;\n };\n showAddonLoader: boolean;\n overwrites?: { [code: string]: Partial<HotelRoomOverwrite> };\n forwardFindReservationToSynxis?: boolean;\n additionalOptions?: { [name: string]: any };\n googleReCaptcha?: {\n loadForMembers?: boolean;\n siteKey?: string;\n };\n /**\n * Show description on RoomDetails\n */\n showDescriptionOnRoomDetails?: boolean;\n /**\n * Customize the Member modal colours. Specifically replacing the green (success) with the primary color of hotel (accent)\n */\n memberOnlyModalUsePrimaryColor?: boolean;\n /**\n * Callback to trigger specific events on load of a hotel.\n *\n * This is where you can specify custom fields, language overrides, feature toggles etc.\n */\n onLoad?: () => void;\n currentRoomSort?: RoomSort; //override default room sort\n maxAdults?: number; //fixed from frontend\n}\n\nexport interface ConfigHotel extends ClientHotelConfig, AdminHotelConfig, HasDatalayerTags {}\n\nexport type Hotel = ConfigHotel & {\n lowestPrice?: {\n value: number;\n isLoading: boolean;\n };\n integrations?: EIntegration[];\n};\n\n/**\n * Used for DetailsHotel event\n */\nexport type InitialHotelDetailsEventPayload = {\n name: string;\n hotelID: number | string;\n hotelUrl: string;\n currency: string;\n language: Language;\n address?: HotelAddress;\n};\n"]}
|
|
@@ -200,28 +200,33 @@ function HotelInfo() {
|
|
|
200
200
|
}
|
|
201
201
|
exports.default = HotelInfo;
|
|
202
202
|
const QuoteImage = ({ src, className, isMobile }) => {
|
|
203
|
-
const [aspectRatio, setAspectRatio] = (0, react_1.useState)(
|
|
204
|
-
const [imageHeight, setImageHeight] = (0, react_1.useState)(
|
|
203
|
+
const [aspectRatio, setAspectRatio] = (0, react_1.useState)(null);
|
|
204
|
+
const [imageHeight, setImageHeight] = (0, react_1.useState)(null);
|
|
205
205
|
(0, react_1.useEffect)(() => {
|
|
206
|
-
if (
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
}, [src
|
|
206
|
+
if (!src)
|
|
207
|
+
return;
|
|
208
|
+
const img = new Image();
|
|
209
|
+
img.src = src;
|
|
210
|
+
img.onload = () => setAspectRatio(img.width > 0 ? img.height / img.width : 1); // Fallback aspect ratio
|
|
211
|
+
img.onerror = () => {
|
|
212
|
+
console.error('Failed to load image');
|
|
213
|
+
setAspectRatio(1);
|
|
214
|
+
};
|
|
215
|
+
}, [src]);
|
|
216
216
|
(0, react_1.useEffect)(() => {
|
|
217
|
-
if (!isMobile ||
|
|
217
|
+
if (!isMobile || aspectRatio === null || typeof window === 'undefined')
|
|
218
218
|
return;
|
|
219
219
|
const updateHeight = () => setImageHeight(window.innerWidth * aspectRatio);
|
|
220
220
|
updateHeight();
|
|
221
221
|
window.addEventListener('resize', updateHeight);
|
|
222
222
|
return () => window.removeEventListener('resize', updateHeight);
|
|
223
223
|
}, [aspectRatio, isMobile]);
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
return (react_1.default.createElement("div", { className: className, style: { width: '100%', textAlign: 'center' } }, src && (react_1.default.createElement("img", { src: src, alt: "Quote", style: {
|
|
225
|
+
width: '100%',
|
|
226
|
+
height: isMobile && imageHeight ? `${imageHeight}px` : 'auto',
|
|
227
|
+
objectFit: 'contain',
|
|
228
|
+
display: 'block',
|
|
229
|
+
margin: '0 auto', // Centers the image in the div
|
|
230
|
+
} }))));
|
|
226
231
|
};
|
|
227
232
|
//# sourceMappingURL=HotelInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotelInfo.js","sourceRoot":"/","sources":["src/pages/hotel/HotelInfo.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA0D;AAC1D,2CAA4D;AAC5D,4DAAoC;AACpC,wEAA0C;AAC1C,uEAAuE;AACvE,+CAA+D;AAC/D,iDAA+C;AAC/C,0DAAuD;AAEvD,6EAAqD;AACrD,6EAAqD;AACrD,uEAAgE;AAChE,iGAAyE;AACzE,8DAA2D;AAC3D,kEAA2D;AAC3D,mGAA0E;AAC1E,2HAAmG;AACnG,mCAA+C;AAC/C,2EAAqE;AACrE,wCAAqC;AACrC,mEAA2C;AA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C;IACpE,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5B,MAAM,KAAK,mBACP,eAAe,EAAE,OAAO,GAAG,GAAG,EAC9B,cAAc,EAAE,OAAO,EACvB,kBAAkB,EAAE,QAAQ,EAC5B,gBAAgB,EAAE,WAAW,EAC7B,KAAK,EAAE,MAAM,IACV,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CACnH,CAAC;IAEF,OAAO,uCAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAQ,CAAC;AAC3D,CAAC,CAAC","sourcesContent":["import { StepHotelInfoViewEvent } from '@frontend/events';\nimport { useCurrentHotel, useEvent } from '@frontend/hooks';\nimport classNames from 'classnames';\nimport FsLightbox from 'fslightbox-react';\nimport { useHistoryConsistentPush } from 'hooks/HistoryConsistentPush';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport HotelLocationMap from '@/components/generic/map/HotelLocationMap';\nimport { PageTitle } from '@/components/generic/PageTitle';\nimport Text, { TextType } from '@/components/generic/Text';\nimport HotelInfoPerkRow from '@/components/steps/hotel/HotelInfoPerksRow';\nimport TransportDistanceFromHotelBlock from '@/components/summary/TransportDistanceFromHotelBlock';\nimport { BookingEngineContext } from '@/index';\nimport ImageProvider, { ImageSize } from '@/providers/ImageProvider';\nimport { Color } from '@/util/Color';\nimport ScreenSize from '@/util/ScreenSize';\nimport StepManager from '@/util/StepManager';\n\nexport default function HotelInfo() {\n const { hotel } = useCurrentHotel();\n const historyConsistentPush = useHistoryConsistentPush();\n const { t } = useTranslation();\n const context = useContext(BookingEngineContext);\n const isMobile = context.screenSize <= ScreenSize.Large;\n\n const imageUrl = hotel?.heroImage;\n\n const { line1, line2, postalCode, country } = hotel?.address ?? {};\n\n const [lightboxController, setLightboxController] = useState({ toggler: false, slide: 1 });\n const [images, setImages] = useState<string[]>([]);\n\n const openSlider = (slide: number) => {\n setLightboxController((controller) => ({ toggler: !controller.toggler, slide: slide + 1 }));\n };\n const openSliderOnClick = () => {\n openSlider(4);\n };\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepHotelInfoViewEvent();\n raise(event);\n }, []);\n\n useEffect(() => {\n const newImages: string[] = [];\n\n if (hotel?.images?.length) {\n newImages.push(...hotel.images);\n }\n\n if (hotel?.rooms) {\n for (const room of Object.values(hotel?.rooms)) {\n room.images?.forEach((image) => {\n newImages.push(image);\n });\n }\n }\n\n setImages(newImages);\n }, [hotel?.images, hotel?.rooms]);\n\n const onBookNowClick = () => {\n historyConsistentPush(StepManager.getFirstStep().getStepUrl());\n };\n\n const getImage = (index: number) => {\n const openSliderOnClickHandler = () => {\n openSlider(index);\n };\n\n const resizedUrl = ImageProvider.resizeImage(images[index], ImageSize.Small);\n\n return (\n <div\n style={{ backgroundImage: `url('${resizedUrl}')`, paddingTop: '75%' }}\n className=\"c-images u-block u-w-100 u-marg-bottom u-marg-bottom--heavy\"\n onClick={openSliderOnClickHandler}\n />\n );\n };\n\n const hotelServices = hotel?.hotelServices?.filter(({ name }) => !!name) || [];\n const quoteImage = isMobile ? hotel?.quoteImageMobile : hotel?.quoteImageDesktop;\n\n return (\n <>\n <PageTitle step=\"HotelInfo\" />\n <div style={{ backgroundImage: `url('${imageUrl && ImageProvider.resizeImage(imageUrl, ImageSize.Original)}')` }} className=\"c-masthead has-tint\">\n <div className=\"container\">\n <div className=\"c-masthead__body u-fill-white u-pad--heavy u-shadow-accent\">\n <h1 className=\"c-masthead__header\">{hotel?.name}</h1>\n <h2 className=\"c-masthead__sub-header\">\n {hotel?.countryPrefix ?? ''} {hotel?.address?.country}\n </h2>\n </div>\n </div>\n </div>\n <div className=\"u-fill-snow u-pad--heavy-med u-pad-top-bottom--heavy@m-\">\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-md-6 u-flex align-items-center\">\n <ul>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Map} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">\n {line1}\n <br />\n {line2} {postalCode}, {country}\n </span>\n </li>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Phone} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">{hotel?.phone}</span>\n </li>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Hotel2} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">\n <a href={hotel?.hotelUrl} style={{ color: 'var(--rs-color-accent-1)' }}>\n {hotel?.name}\n </a>\n </span>\n </li>\n <li className=\"u-flex\">\n <BEButton icon={IconType.ArrowRight} primary filled iconPosition=\"right\" onClick={onBookNowClick}>\n {t(Translation.Misc.BookNow)}\n </BEButton>\n </li>\n </ul>\n </div>\n <div className=\"col-md-6\">\n <div className=\"c-overlap\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy u-marg-top u-marg-top--heavy\" style={{ height: '240px' }}>\n <HotelLocationMap />\n </div>\n <div className=\"u-flex u-flex-column justify-content-center rs-hotelinfo-transport-distance u-w-100\">\n <TransportDistanceFromHotelBlock hotel={hotel} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"u-pad u-pad--heavy-plus u-pad-top-bottom--heavy@m-\">\n <div className=\"container rs-hotelinfo\">\n <div className=\"row\">\n <div className=\"col-lg-6\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-about\" bold>\n {t(Translation.Step.Hotel.About)}\n </Headline>\n </div>\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Text type={TextType.Small}>\n <span dangerouslySetInnerHTML={{ __html: hotel?.description?.replace('\\r\\n', '<br/><br/>') || '' }} />\n </Text>\n {!!hotel?.locationDescription && (\n <>\n <div className=\"u-marg-top\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Hotel.Location)}</strong>\n </Text>\n </div>\n <Text type={TextType.Small}>\n <span dangerouslySetInnerHTML={{ __html: hotel?.locationDescription?.replace('\\r\\n', '<br/><br/>') }} />\n </Text>\n </>\n )}\n </div>\n {!!hotel?.perks?.length && (\n <>\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Text type={TextType.Small}>\n <strong className=\"rs-hotelinfo-andyougetall\">{hotel.perkTitle || t(Translation.Step.Hotel.AndYouGetAll)}</strong>\n </Text>\n </div>\n <div className=\"row\">\n <HotelInfoPerkRow hotel={hotel} />\n </div>\n {hotel?.perksShowDisclaimer && (\n <div className=\"row u-marg-top--lighter\">\n <small className=\"col-12\">{t(Translation.Misc.PerksDisclaimer)}</small>\n </div>\n )}\n </>\n )}\n </div>\n {!!hotelServices.length && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-hotelamenities\" bold>\n {t(Translation.Step.Hotel.HotelAmenities)}\n </Headline>\n </div>\n <div className=\"row\">\n {hotelServices.map((hotelService, index) => {\n return (\n <div key={index} className=\"col-md-6\">\n <div className=\"u-flex u-marg-bottom\">\n <Icon icon={IconType.Check} color={Color.White} backgroundColor={Color.Accent} borderRadius=\"round\" noPadding size=\"16px\" />\n <span className=\"u-flex__item u-marg-left--light\">\n <Text type={TextType.Small}>{hotelService.name}</Text>\n </span>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n )}\n {!!hotel?.policies && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-policies\" bold>\n {t(Translation.Step.Hotel.Policies)}\n </Headline>\n </div>\n <Text type={TextType.Small}>\n <a href={hotel?.policies} target=\"_blank\" style={{ color: hotel?.colors.accent }} rel=\"noreferrer\">\n {hotel?.policies}\n </a>\n </Text>\n </div>\n )}\n\n {quoteImage && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <QuoteImage\n isMobile={isMobile}\n className={classNames('u-marg-bottom--heavy rs-hotelinfo-quote-images', {\n '--mobile': isMobile,\n '--desktop': !isMobile,\n })}\n src={quoteImage}\n ></QuoteImage>\n </div>\n )}\n </div>\n <div className=\"col-lg-6\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-gallery\" bold>\n {t(Translation.Step.Hotel.Gallery)}\n </Headline>\n </div>\n {images.length >= 1 && getImage(0)}\n <div className=\"row\">\n {[1, 2, 3].map((index) => {\n if (images.length > index) {\n return (\n <div key={index} className=\"col-6\">\n {getImage(index)}\n </div>\n );\n }\n })}\n {images.length > 5 && (\n <div className=\"col-6\">\n <div className=\"c-images c-images--more\" onClick={openSliderOnClick}>\n {getImage(4)}\n <span>+ {images.length - 5}</span>\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n {!!images?.length && (\n <FsLightbox\n toggler={lightboxController.toggler}\n slide={lightboxController.slide}\n sources={images.map((image) => ImageProvider.resizeImage(image, ImageSize.Original))}\n type=\"image\"\n />\n )}\n </>\n );\n}\n\nconst QuoteImage = ({ src, className, isMobile }: { src: string; className: string; isMobile: boolean }) => {\n const [aspectRatio, setAspectRatio] = useState(0);\n const [imageHeight, setImageHeight] = useState(0);\n\n useEffect(() => {\n if (isMobile && src) {\n const img = new Image();\n img.src = src;\n img.onload = () => setAspectRatio(img.height / img.width);\n img.onerror = () => {\n console.error('Failed to load image');\n setAspectRatio(0);\n };\n }\n }, [src, isMobile]);\n\n useEffect(() => {\n if (!isMobile || !window) return;\n\n const updateHeight = () => setImageHeight(window.innerWidth * aspectRatio);\n updateHeight();\n\n window.addEventListener('resize', updateHeight);\n return () => window.removeEventListener('resize', updateHeight);\n }, [aspectRatio, isMobile]);\n\n const style = {\n backgroundImage: `url(${src})`,\n backgroundSize: 'cover',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat',\n width: '100%',\n ...(isMobile ? { maxWidth: '100vw', height: imageHeight ? `${imageHeight}px` : 'auto' } : { paddingTop: '75%' }),\n };\n\n return <div className={className} style={style}></div>;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"HotelInfo.js","sourceRoot":"/","sources":["src/pages/hotel/HotelInfo.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA0D;AAC1D,2CAA4D;AAC5D,4DAAoC;AACpC,wEAA0C;AAC1C,uEAAuE;AACvE,+CAA+D;AAC/D,iDAA+C;AAC/C,0DAAuD;AAEvD,6EAAqD;AACrD,6EAAqD;AACrD,uEAAgE;AAChE,iGAAyE;AACzE,8DAA2D;AAC3D,kEAA2D;AAC3D,mGAA0E;AAC1E,2HAAmG;AACnG,mCAA+C;AAC/C,2EAAqE;AACrE,wCAAqC;AACrC,mEAA2C;AAC3C,qEAA6C;AAE7C,SAAwB,SAAS;;IAC7B,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,uBAAe,GAAE,CAAC;IACpC,MAAM,qBAAqB,GAAG,IAAA,gDAAwB,GAAE,CAAC;IACzD,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,4BAAoB,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,IAAI,oBAAU,CAAC,KAAK,CAAC;IAExD,MAAM,QAAQ,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,C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E,QAAQ,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,CAAC,CAAC,CAAC,MAAM;YAC7D,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,OAAO;YAChB,MAAM,EAAE,QAAQ,EAAE,+BAA+B;SACpD,GACH,CACL,CACC,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { StepHotelInfoViewEvent } from '@frontend/events';\nimport { useCurrentHotel, useEvent } from '@frontend/hooks';\nimport classNames from 'classnames';\nimport FsLightbox from 'fslightbox-react';\nimport { useHistoryConsistentPush } from 'hooks/HistoryConsistentPush';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport HotelLocationMap from '@/components/generic/map/HotelLocationMap';\nimport { PageTitle } from '@/components/generic/PageTitle';\nimport Text, { TextType } from '@/components/generic/Text';\nimport HotelInfoPerkRow from '@/components/steps/hotel/HotelInfoPerksRow';\nimport TransportDistanceFromHotelBlock from '@/components/summary/TransportDistanceFromHotelBlock';\nimport { BookingEngineContext } from '@/index';\nimport ImageProvider, { ImageSize } from '@/providers/ImageProvider';\nimport { Color } from '@/util/Color';\nimport ScreenSize from '@/util/ScreenSize';\nimport StepManager from '@/util/StepManager';\n\nexport default function HotelInfo() {\n const { hotel } = useCurrentHotel();\n const historyConsistentPush = useHistoryConsistentPush();\n const { t } = useTranslation();\n const context = useContext(BookingEngineContext);\n const isMobile = context.screenSize <= ScreenSize.Large;\n\n const imageUrl = hotel?.heroImage;\n\n const { line1, line2, postalCode, country } = hotel?.address ?? {};\n\n const [lightboxController, setLightboxController] = useState({ toggler: false, slide: 1 });\n const [images, setImages] = useState<string[]>([]);\n\n const openSlider = (slide: number) => {\n setLightboxController((controller) => ({ toggler: !controller.toggler, slide: slide + 1 }));\n };\n const openSliderOnClick = () => {\n openSlider(4);\n };\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepHotelInfoViewEvent();\n raise(event);\n }, []);\n\n useEffect(() => {\n const newImages: string[] = [];\n\n if (hotel?.images?.length) {\n newImages.push(...hotel.images);\n }\n\n if (hotel?.rooms) {\n for (const room of Object.values(hotel?.rooms)) {\n room.images?.forEach((image) => {\n newImages.push(image);\n });\n }\n }\n\n setImages(newImages);\n }, [hotel?.images, hotel?.rooms]);\n\n const onBookNowClick = () => {\n historyConsistentPush(StepManager.getFirstStep().getStepUrl());\n };\n\n const getImage = (index: number) => {\n const openSliderOnClickHandler = () => {\n openSlider(index);\n };\n\n const resizedUrl = ImageProvider.resizeImage(images[index], ImageSize.Small);\n\n return (\n <div\n style={{ backgroundImage: `url('${resizedUrl}')`, paddingTop: '75%' }}\n className=\"c-images u-block u-w-100 u-marg-bottom u-marg-bottom--heavy\"\n onClick={openSliderOnClickHandler}\n />\n );\n };\n\n const hotelServices = hotel?.hotelServices?.filter(({ name }) => !!name) || [];\n const quoteImage = isMobile ? hotel?.quoteImageMobile : hotel?.quoteImageDesktop;\n\n return (\n <>\n <PageTitle step=\"HotelInfo\" />\n <div style={{ backgroundImage: `url('${imageUrl && ImageProvider.resizeImage(imageUrl, ImageSize.Original)}')` }} className=\"c-masthead has-tint\">\n <div className=\"container\">\n <div className=\"c-masthead__body u-fill-white u-pad--heavy u-shadow-accent\">\n <h1 className=\"c-masthead__header\">{hotel?.name}</h1>\n <h2 className=\"c-masthead__sub-header\">\n {hotel?.countryPrefix ?? ''} {hotel?.address?.country}\n </h2>\n </div>\n </div>\n </div>\n <div className=\"u-fill-snow u-pad--heavy-med u-pad-top-bottom--heavy@m-\">\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-md-6 u-flex align-items-center\">\n <ul>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Map} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">\n {line1}\n <br />\n {line2} {postalCode}, {country}\n </span>\n </li>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Phone} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">{hotel?.phone}</span>\n </li>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Hotel2} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">\n <a href={hotel?.hotelUrl} style={{ color: 'var(--rs-color-accent-1)' }}>\n {hotel?.name}\n </a>\n </span>\n </li>\n <li className=\"u-flex\">\n <BEButton icon={IconType.ArrowRight} primary filled iconPosition=\"right\" onClick={onBookNowClick}>\n {t(Translation.Misc.BookNow)}\n </BEButton>\n </li>\n </ul>\n </div>\n <div className=\"col-md-6\">\n <div className=\"c-overlap\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy u-marg-top u-marg-top--heavy\" style={{ height: '240px' }}>\n <HotelLocationMap />\n </div>\n <div className=\"u-flex u-flex-column justify-content-center rs-hotelinfo-transport-distance u-w-100\">\n <TransportDistanceFromHotelBlock hotel={hotel} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"u-pad u-pad--heavy-plus u-pad-top-bottom--heavy@m-\">\n <div className=\"container rs-hotelinfo\">\n <div className=\"row\">\n <div className=\"col-lg-6\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-about\" bold>\n {t(Translation.Step.Hotel.About)}\n </Headline>\n </div>\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Text type={TextType.Small}>\n <span dangerouslySetInnerHTML={{ __html: hotel?.description?.replace('\\r\\n', '<br/><br/>') || '' }} />\n </Text>\n {!!hotel?.locationDescription && (\n <>\n <div className=\"u-marg-top\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Hotel.Location)}</strong>\n </Text>\n </div>\n <Text type={TextType.Small}>\n <span dangerouslySetInnerHTML={{ __html: hotel?.locationDescription?.replace('\\r\\n', '<br/><br/>') }} />\n </Text>\n </>\n )}\n </div>\n {!!hotel?.perks?.length && (\n <>\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Text type={TextType.Small}>\n <strong className=\"rs-hotelinfo-andyougetall\">{hotel.perkTitle || t(Translation.Step.Hotel.AndYouGetAll)}</strong>\n </Text>\n </div>\n <div className=\"row\">\n <HotelInfoPerkRow hotel={hotel} />\n </div>\n {hotel?.perksShowDisclaimer && (\n <div className=\"row u-marg-top--lighter\">\n <small className=\"col-12\">{t(Translation.Misc.PerksDisclaimer)}</small>\n </div>\n )}\n </>\n )}\n </div>\n {!!hotelServices.length && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-hotelamenities\" bold>\n {t(Translation.Step.Hotel.HotelAmenities)}\n </Headline>\n </div>\n <div className=\"row\">\n {hotelServices.map((hotelService, index) => {\n return (\n <div key={index} className=\"col-md-6\">\n <div className=\"u-flex u-marg-bottom\">\n <Icon icon={IconType.Check} color={Color.White} backgroundColor={Color.Accent} borderRadius=\"round\" noPadding size=\"16px\" />\n <span className=\"u-flex__item u-marg-left--light\">\n <Text type={TextType.Small}>{hotelService.name}</Text>\n </span>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n )}\n {!!hotel?.policies && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-policies\" bold>\n {t(Translation.Step.Hotel.Policies)}\n </Headline>\n </div>\n <Text type={TextType.Small}>\n <a href={hotel?.policies} target=\"_blank\" style={{ color: hotel?.colors.accent }} rel=\"noreferrer\">\n {hotel?.policies}\n </a>\n </Text>\n </div>\n )}\n\n {quoteImage && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <QuoteImage\n isMobile={isMobile}\n className={classNames('u-marg-bottom--heavy rs-hotelinfo-quote-images', {\n '--mobile': isMobile,\n '--desktop': !isMobile,\n })}\n src={quoteImage}\n ></QuoteImage>\n </div>\n )}\n </div>\n <div className=\"col-lg-6\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-gallery\" bold>\n {t(Translation.Step.Hotel.Gallery)}\n </Headline>\n </div>\n {images.length >= 1 && getImage(0)}\n <div className=\"row\">\n {[1, 2, 3].map((index) => {\n if (images.length > index) {\n return (\n <div key={index} className=\"col-6\">\n {getImage(index)}\n </div>\n );\n }\n })}\n {images.length > 5 && (\n <div className=\"col-6\">\n <div className=\"c-images c-images--more\" onClick={openSliderOnClick}>\n {getImage(4)}\n <span>+ {images.length - 5}</span>\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n {!!images?.length && (\n <FsLightbox\n toggler={lightboxController.toggler}\n slide={lightboxController.slide}\n sources={images.map((image) => ImageProvider.resizeImage(image, ImageSize.Original))}\n type=\"image\"\n />\n )}\n </>\n );\n}\n\nconst QuoteImage = ({ src, className, isMobile }: { src: string; className?: string; isMobile: boolean }) => {\n const [aspectRatio, setAspectRatio] = useState<number | null>(null);\n const [imageHeight, setImageHeight] = useState<number | null>(null);\n\n useEffect(() => {\n if (!src) return;\n\n const img = new Image();\n img.src = src;\n img.onload = () => setAspectRatio(img.width > 0 ? img.height / img.width : 1); // Fallback aspect ratio\n img.onerror = () => {\n console.error('Failed to load image');\n setAspectRatio(1);\n };\n }, [src]);\n\n useEffect(() => {\n if (!isMobile || aspectRatio === null || typeof window === 'undefined') return;\n\n const updateHeight = () => setImageHeight(window.innerWidth * aspectRatio);\n updateHeight();\n\n window.addEventListener('resize', updateHeight);\n return () => window.removeEventListener('resize', updateHeight);\n }, [aspectRatio, isMobile]);\n\n return (\n <div className={className} style={{ width: '100%', textAlign: 'center' }}>\n {src && (\n <img\n src={src}\n alt=\"Quote\"\n style={{\n width: '100%',\n height: isMobile && imageHeight ? `${imageHeight}px` : 'auto',\n objectFit: 'contain', // Ensures full image is visible, no cropping\n display: 'block', // Prevents inline whitespace issue\n margin: '0 auto', // Centers the image in the div\n }}\n />\n )}\n </div>\n );\n};\n"]}
|