diff --git a/apps/scandic-web/components/HotelReservation/HotelCard/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCard/index.tsx index f10377cc8..a25b9042a 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCard/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCard/index.tsx @@ -15,7 +15,10 @@ import { Divider } from "@scandic-hotels/design-system/Divider" import HotelLogoIcon from "@scandic-hotels/design-system/Icons/HotelLogoIcon" import { Typography } from "@scandic-hotels/design-system/Typography" -import { selectHotelMap } from "@/constants/routes/hotelReservation" +import { + alternativeHotelsMap, + selectHotelMap, +} from "@/constants/routes/hotelReservation" import { useHotelsMapStore } from "@/stores/hotels-map" import BookingCodeChip from "@/components/BookingCodeChip" @@ -49,6 +52,7 @@ function HotelCard({ state = "default", type = HotelCardListingTypeEnum.PageListing, bookingCode = "", + isAlternative, }: HotelCardProps) { const params = useParams() const searchParams = useSearchParams() @@ -65,11 +69,14 @@ function HotelCard({ state, }) + const mapUrl = isAlternative + ? alternativeHotelsMap(lang) + : selectHotelMap(lang) const handleAddressClick = (event: React.MouseEvent) => { event.preventDefault() disengage() // Disengage the current hotel to avoid the hover state from being active when clicking on the address activate(hotel.name) - router.push(`${selectHotelMap(lang)}?${searchParams.toString()}`) + router.push(`${mapUrl}?${searchParams.toString()}`) } const addressStr = `${hotel.address.streetAddress}, ${hotel.address.city}` @@ -126,7 +133,7 @@ function HotelCard({ size="small" textDecoration="underline" onClick={handleAddressClick} - href={selectHotelMap(lang)} + href={mapUrl} keepSearchParams aria-label={intl.formatMessage({ defaultMessage: "See on map", diff --git a/apps/scandic-web/components/HotelReservation/HotelCardListing/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCardListing/index.tsx index 5c011c436..2c4a9e086 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCardListing/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCardListing/index.tsx @@ -27,6 +27,7 @@ export default function HotelCardListing({ hotelData, unfilteredHotelCount, type = HotelCardListingTypeEnum.PageListing, + isAlternative, }: HotelCardListingProps) { const { data: session } = useSession() const isUserLoggedIn = isValidClientSession(session) @@ -133,6 +134,7 @@ export default function HotelCardListing({ } type={type} bookingCode={bookingCode} + isAlternative={isAlternative} /> )) diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer.tsx b/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer.tsx index 8fc99701b..84b9aa502 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer.tsx @@ -108,6 +108,7 @@ export async function SelectHotelMapContainer({ cityCoordinates={cityCoordinates} bookingCode={bookingCode ?? ""} isBookingCodeRateAvailable={isBookingCodeRateAvailable} + isAlternativeHotels={isAlternativeHotels} /> diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContent/index.tsx b/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContent/index.tsx index 0d4d1054c..07ce2e49d 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContent/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContent/index.tsx @@ -6,7 +6,10 @@ import { useMediaQuery } from "usehooks-ts" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" -import { selectHotel } from "@/constants/routes/hotelReservation" +import { + alternativeHotels, + selectHotel, +} from "@/constants/routes/hotelReservation" import { useBookingCodeFilterStore } from "@/stores/bookingCode-filter" import { useHotelFilterStore } from "@/stores/hotel-filters" import { useHotelsMapStore } from "@/stores/hotels-map" @@ -41,6 +44,7 @@ export default function SelectHotelContent({ filterList, bookingCode, isBookingCodeRateAvailable, + isAlternativeHotels, }: Omit) { const lang = useLang() const intl = useIntl() @@ -122,6 +126,9 @@ export default function SelectHotelContent({ [map, getHotelCards, isAboveMobile] ) + const closeMapUrl = isAlternativeHotels + ? alternativeHotels(lang) + : selectHotel(lang) const closeButton = (