diff --git a/apps/scandic-web/components/HotelReservation/MyStay/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/index.tsx index 649463675..925d36682 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/index.tsx @@ -3,7 +3,6 @@ import { notFound } from "next/navigation" import { Typography } from "@scandic-hotels/design-system/Typography" -import { homeHrefs } from "@/constants/homeHrefs" import { env } from "@/env/server" import { dt } from "@/lib/dt" import { @@ -18,6 +17,7 @@ import { decrypt } from "@/server/routers/utils/encryption" import Image from "@/components/Image" import { getIntl } from "@/i18n" import { getLang } from "@/i18n/serverContext" +import { getCurrentWebUrl } from "@/utils/url" import AdditionalInfoForm from "../FindMyBooking/AdditionalInfoForm" import accessBooking, { @@ -86,6 +86,13 @@ export async function MyStay({ refId }: { refId: string }) { additionalData.gallery?.heroImages[0]?.imageSizes.large ?? hotel.galleryImages[0]?.imageSizes.large + const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com" + const promoUrl = env.HIDE_FOR_NEXT_RELEASE + ? new URL(getCurrentWebUrl("/", lang)) + : new URL(`${baseUrl}/${lang}/`) + + promoUrl.searchParams.set("hotel", hotel.operaId) + return (
@@ -131,7 +138,7 @@ export async function MyStay({ refId }: { refId: string }) { id: "Get inspired and start dreaming beyond your next trip. Explore more Scandic destinations.", })} buttonText={intl.formatMessage({ id: "Explore Scandic hotels" })} - href={`${homeHrefs[env.NODE_ENV][lang]}?hotel=${hotel.operaId}`} + href={promoUrl.toString()} image={hotel.hotelContent.images} />