Merged in chore/next15 (pull request #1999)
chore (SW-834): Upgrade to Next 15 * wip: apply codemod and upgrade swc plugin * wip: design-system to react 19, fix issues from async (search)params * wip: fix remaining issues from codemod serverClient is now async because context use headers() getLang is now async because it uses headers() * Minor cleanup * Inline react-material-symbols package Package is seemingly not maintained any more and doesn't support React 19. This copies the package source into `design-system`, makes the necessary changes for 19 and export it for others to use. * Fix missing awaits * Disable modal exit animations Enabling modal exit animations via isExiting prop is causing modals to be rendered in "hidden" state and never unmount. Seems to be an issue with react-aria-components, see https://github.com/adobe/react-spectrum/issues/7563. Can probably be fixed by rewriting to a solution similar to https://react-spectrum.adobe.com/react-aria/examples/framer-modal-sheet.html * Remove unstable cache implementation and use in memory cache locally * Fix ref type in SelectFilter * Use cloneElement to add key prop to element Approved-by: Linus Flood
This commit is contained in:
@@ -10,7 +10,7 @@ import { signOut } from "@/auth"
|
|||||||
|
|
||||||
export async function GET(
|
export async function GET(
|
||||||
request: NextRequest,
|
request: NextRequest,
|
||||||
context: { params: { lang: Lang } }
|
context: { params: Promise<{ lang: Lang }> }
|
||||||
) {
|
) {
|
||||||
const publicURL = getPublicURL(request)
|
const publicURL = getPublicURL(request)
|
||||||
|
|
||||||
@@ -49,7 +49,8 @@ export async function GET(
|
|||||||
try {
|
try {
|
||||||
// Initiate the seamless logout flow
|
// Initiate the seamless logout flow
|
||||||
let redirectUrlValue
|
let redirectUrlValue
|
||||||
switch (context.params.lang) {
|
const params = await context.params
|
||||||
|
switch (params.lang) {
|
||||||
case Lang.da:
|
case Lang.da:
|
||||||
redirectUrlValue = env.SEAMLESS_LOGOUT_DA
|
redirectUrlValue = env.SEAMLESS_LOGOUT_DA
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ export { generateMetadata } from "@/utils/generateMetadata"
|
|||||||
export default async function MyPages({}: PageArgs<
|
export default async function MyPages({}: PageArgs<
|
||||||
LangParams & { path: string[] }
|
LangParams & { path: string[] }
|
||||||
>) {
|
>) {
|
||||||
const accountPageRes = await serverClient().contentstack.accountPage.get()
|
const caller = await serverClient()
|
||||||
|
const accountPageRes = await caller.contentstack.accountPage.get()
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
|
|
||||||
if (!accountPageRes) {
|
if (!accountPageRes) {
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ import TrackingSDK from "@/components/TrackingSDK"
|
|||||||
import styles from "./page.module.css"
|
import styles from "./page.module.css"
|
||||||
|
|
||||||
export default async function EditProfileSlot() {
|
export default async function EditProfileSlot() {
|
||||||
const accountPage = await serverClient().contentstack.accountPage.get()
|
const caller = await serverClient()
|
||||||
|
const accountPage = await caller.contentstack.accountPage.get()
|
||||||
const user = await getProfile()
|
const user = await getProfile()
|
||||||
|
|
||||||
if (!user || "error" in user) {
|
if (!user || "error" in user) {
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import type { LangParams, PageArgs } from "@/types/params"
|
|||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/generateMetadata"
|
||||||
|
|
||||||
export default async function ProfilePage({}: PageArgs<LangParams>) {
|
export default async function ProfilePage({}: PageArgs<LangParams>) {
|
||||||
const accountPage = await serverClient().contentstack.accountPage.get()
|
const caller = await serverClient()
|
||||||
|
const accountPage = await caller.contentstack.accountPage.get()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ import InitLivePreview from "@/components/LivePreview"
|
|||||||
|
|
||||||
import type { PageArgs, UIDParams } from "@/types/params"
|
import type { PageArgs, UIDParams } from "@/types/params"
|
||||||
|
|
||||||
export default function PreviewPage({
|
export default async function PreviewPage(
|
||||||
searchParams,
|
props: PageArgs<UIDParams, URLSearchParams>
|
||||||
params,
|
) {
|
||||||
}: PageArgs<UIDParams, URLSearchParams>) {
|
const params = await props.params
|
||||||
|
const searchParams = await props.searchParams
|
||||||
const shouldInitializePreview = searchParams.isPreview === "true"
|
const shouldInitializePreview = searchParams.isPreview === "true"
|
||||||
|
|
||||||
if (searchParams.live_preview) {
|
if (searchParams.live_preview) {
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ import { isLoggedInUser } from "@/utils/isLoggedInUser"
|
|||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/generateMetadata"
|
||||||
|
|
||||||
export default async function ContentPagePage() {
|
export default async function ContentPagePage() {
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const pathname = headers().get("x-pathname") || ""
|
const headersList = await headers()
|
||||||
|
const pathname = headersList.get("x-pathname") || ""
|
||||||
const isSignupRoute = isSignupPage(pathname)
|
const isSignupRoute = isSignupPage(pathname)
|
||||||
|
|
||||||
if (isSignupRoute) {
|
if (isSignupRoute) {
|
||||||
|
|||||||
@@ -10,9 +10,10 @@ import type { PageArgs } from "@/types/params"
|
|||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/generateMetadata"
|
||||||
|
|
||||||
export default function DestinationCityPagePage({
|
export default async function DestinationCityPagePage(
|
||||||
searchParams,
|
props: PageArgs<{}, { view?: "map" }>
|
||||||
}: PageArgs<{}, { view?: "map" }>) {
|
) {
|
||||||
|
const searchParams = await props.searchParams
|
||||||
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
|
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
|
||||||
return notFound()
|
return notFound()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,9 +11,10 @@ import type { PageArgs } from "@/types/params"
|
|||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/generateMetadata"
|
||||||
|
|
||||||
export default async function HotelPagePage({
|
export default async function HotelPagePage(
|
||||||
searchParams,
|
props: PageArgs<{}, { subpage?: string; view?: "map" }>
|
||||||
}: PageArgs<{}, { subpage?: string; view?: "map" }>) {
|
) {
|
||||||
|
const searchParams = await props.searchParams
|
||||||
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
|
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
|
||||||
return notFound()
|
return notFound()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,9 +9,10 @@ import type { PageArgs } from "@/types/params"
|
|||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/generateMetadata"
|
||||||
|
|
||||||
export default function StartPagePage({
|
export default async function StartPagePage(
|
||||||
searchParams,
|
props: PageArgs<{}, BookingWidgetSearchData>
|
||||||
}: PageArgs<{}, BookingWidgetSearchData>) {
|
) {
|
||||||
|
const searchParams = await props.searchParams
|
||||||
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
|
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
|
||||||
return notFound()
|
return notFound()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,22 +9,19 @@ import { decrypt } from "@/utils/encryption"
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function BookingConfirmationPage({
|
export default async function BookingConfirmationPage(
|
||||||
params,
|
props: PageArgs<LangParams, { RefId?: string }>
|
||||||
searchParams,
|
) {
|
||||||
}: PageArgs<
|
const searchParams = await props.searchParams
|
||||||
LangParams,
|
const params = await props.params
|
||||||
{
|
|
||||||
RefId?: string
|
|
||||||
}
|
|
||||||
>) {
|
|
||||||
const refId = searchParams.RefId
|
const refId = searchParams.RefId
|
||||||
|
|
||||||
if (!refId) {
|
if (!refId) {
|
||||||
notFound()
|
notFound()
|
||||||
}
|
}
|
||||||
|
|
||||||
const sig = cookies().get("bcsig")?.value
|
const cookieStore = await cookies()
|
||||||
|
const sig = cookieStore.get("bcsig")?.value
|
||||||
|
|
||||||
if (!sig) {
|
if (!sig) {
|
||||||
redirect(`/${params.lang}`)
|
redirect(`/${params.lang}`)
|
||||||
|
|||||||
@@ -13,10 +13,8 @@ import LoadingSpinner from "@/components/LoadingSpinner"
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function GuaranteePaymentCallbackPage({
|
export default async function GuaranteePaymentCallbackPage(
|
||||||
params,
|
props: PageArgs<
|
||||||
searchParams,
|
|
||||||
}: PageArgs<
|
|
||||||
LangParams,
|
LangParams,
|
||||||
{
|
{
|
||||||
status?: PaymentCallbackStatusEnum
|
status?: PaymentCallbackStatusEnum
|
||||||
@@ -24,7 +22,10 @@ export default async function GuaranteePaymentCallbackPage({
|
|||||||
confirmationNumber?: string
|
confirmationNumber?: string
|
||||||
ancillary?: string
|
ancillary?: string
|
||||||
}
|
}
|
||||||
>) {
|
>
|
||||||
|
) {
|
||||||
|
const searchParams = await props.searchParams
|
||||||
|
const params = await props.params
|
||||||
console.log(`[gla-payment-callback] callback started`)
|
console.log(`[gla-payment-callback] callback started`)
|
||||||
const lang = params.lang
|
const lang = params.lang
|
||||||
const status = searchParams.status
|
const status = searchParams.status
|
||||||
@@ -57,7 +58,8 @@ export default async function GuaranteePaymentCallbackPage({
|
|||||||
|
|
||||||
if (refId) {
|
if (refId) {
|
||||||
try {
|
try {
|
||||||
const bookingStatus = await serverClient().booking.status({
|
const caller = await serverClient()
|
||||||
|
const bookingStatus = await caller.booking.status({
|
||||||
refId,
|
refId,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -20,17 +20,18 @@ import { isValidSession } from "@/utils/session"
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function PaymentCallbackPage({
|
export default async function PaymentCallbackPage(
|
||||||
params,
|
props: PageArgs<
|
||||||
searchParams,
|
|
||||||
}: PageArgs<
|
|
||||||
LangParams,
|
LangParams,
|
||||||
{
|
{
|
||||||
status?: PaymentCallbackStatusEnum
|
status?: PaymentCallbackStatusEnum
|
||||||
confirmationNumber?: string
|
confirmationNumber?: string
|
||||||
hotel?: string
|
hotel?: string
|
||||||
}
|
}
|
||||||
>) {
|
>
|
||||||
|
) {
|
||||||
|
const searchParams = await props.searchParams
|
||||||
|
const params = await props.params
|
||||||
console.log(`[payment-callback] callback started`)
|
console.log(`[payment-callback] callback started`)
|
||||||
const lang = params.lang
|
const lang = params.lang
|
||||||
const status = searchParams.status
|
const status = searchParams.status
|
||||||
@@ -87,7 +88,8 @@ export default async function PaymentCallbackPage({
|
|||||||
|
|
||||||
if (refId) {
|
if (refId) {
|
||||||
try {
|
try {
|
||||||
const bookingStatus = await serverClient().booking.status({
|
const caller = await serverClient()
|
||||||
|
const bookingStatus = await caller.booking.status({
|
||||||
refId,
|
refId,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -3,15 +3,21 @@ import { Suspense } from "react"
|
|||||||
import { SelectHotelMapContainer } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer"
|
import { SelectHotelMapContainer } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer"
|
||||||
import { SelectHotelMapContainerSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainerSkeleton"
|
import { SelectHotelMapContainerSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainerSkeleton"
|
||||||
import { MapContainer } from "@/components/MapContainer"
|
import { MapContainer } from "@/components/MapContainer"
|
||||||
|
import { convertSearchParamsToObj } from "@/utils/url"
|
||||||
|
|
||||||
import styles from "./page.module.css"
|
import styles from "./page.module.css"
|
||||||
|
|
||||||
import type { AlternativeHotelsSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams"
|
import type { AlternativeHotelsSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams"
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function SelectHotelMapPage({
|
export default async function SelectHotelMapPage(
|
||||||
searchParams,
|
props: PageArgs<LangParams, AlternativeHotelsSearchParams>
|
||||||
}: PageArgs<LangParams, AlternativeHotelsSearchParams>) {
|
) {
|
||||||
|
const searchParams = await props.searchParams
|
||||||
|
|
||||||
|
const booking =
|
||||||
|
convertSearchParamsToObj<AlternativeHotelsSearchParams>(searchParams)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.main}>
|
<div className={styles.main}>
|
||||||
<MapContainer>
|
<MapContainer>
|
||||||
@@ -19,10 +25,7 @@ export default async function SelectHotelMapPage({
|
|||||||
key={searchParams.hotel}
|
key={searchParams.hotel}
|
||||||
fallback={<SelectHotelMapContainerSkeleton />}
|
fallback={<SelectHotelMapContainerSkeleton />}
|
||||||
>
|
>
|
||||||
<SelectHotelMapContainer
|
<SelectHotelMapContainer booking={booking} isAlternativeHotels />
|
||||||
searchParams={searchParams}
|
|
||||||
isAlternativeHotels
|
|
||||||
/>
|
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</MapContainer>
|
</MapContainer>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,21 +12,26 @@ import { getHotels } from "@/components/HotelReservation/SelectHotel/helpers"
|
|||||||
import { getTracking } from "@/components/HotelReservation/SelectHotel/tracking"
|
import { getTracking } from "@/components/HotelReservation/SelectHotel/tracking"
|
||||||
import TrackingSDK from "@/components/TrackingSDK"
|
import TrackingSDK from "@/components/TrackingSDK"
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
import { setLang } from "@/i18n/serverContext"
|
|
||||||
import { getHotelSearchDetails } from "@/utils/hotelSearchDetails"
|
import { getHotelSearchDetails } from "@/utils/hotelSearchDetails"
|
||||||
|
import { convertSearchParamsToObj } from "@/utils/url"
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
AlternativeHotelsSearchParams,
|
AlternativeHotelsSearchParams,
|
||||||
SelectHotelSearchParams,
|
SelectHotelSearchParams,
|
||||||
} from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams"
|
} from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams"
|
||||||
|
import { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function AlternativeHotelsPage({
|
export default async function AlternativeHotelsPage(
|
||||||
params,
|
props: PageArgs<LangParams, AlternativeHotelsSearchParams>
|
||||||
searchParams,
|
) {
|
||||||
}: PageArgs<LangParams, AlternativeHotelsSearchParams>) {
|
const searchParams = await props.searchParams
|
||||||
setLang(params.lang)
|
const params = await props.params
|
||||||
const searchDetails = await getHotelSearchDetails({ searchParams }, true)
|
|
||||||
|
const booking =
|
||||||
|
convertSearchParamsToObj<AlternativeHotelsSearchParams>(searchParams)
|
||||||
|
|
||||||
|
const searchDetails = await getHotelSearchDetails(booking, true)
|
||||||
|
|
||||||
if (!searchDetails || !searchDetails.hotel || !searchDetails.city) {
|
if (!searchDetails || !searchDetails.hotel || !searchDetails.city) {
|
||||||
return notFound()
|
return notFound()
|
||||||
@@ -44,7 +49,7 @@ export default async function AlternativeHotelsPage({
|
|||||||
} = searchDetails
|
} = searchDetails
|
||||||
|
|
||||||
if (bookingCode && FamilyAndFriendsCodes.includes(bookingCode)) {
|
if (bookingCode && FamilyAndFriendsCodes.includes(bookingCode)) {
|
||||||
const cookieStore = cookies()
|
const cookieStore = await cookies()
|
||||||
const isInvalidFNF = cookieStore.get("sc")?.value !== "1"
|
const isInvalidFNF = cookieStore.get("sc")?.value !== "1"
|
||||||
|
|
||||||
if (isInvalidFNF) {
|
if (isInvalidFNF) {
|
||||||
@@ -55,7 +60,7 @@ export default async function AlternativeHotelsPage({
|
|||||||
// TODO: This needs to be refactored into its
|
// TODO: This needs to be refactored into its
|
||||||
// own functions
|
// own functions
|
||||||
const hotels = await getHotels(
|
const hotels = await getHotels(
|
||||||
selectHotelParams as SelectHotelSearchParams,
|
selectHotelParams,
|
||||||
isAlternativeFor,
|
isAlternativeFor,
|
||||||
bookingCode,
|
bookingCode,
|
||||||
city,
|
city,
|
||||||
|
|||||||
@@ -27,10 +27,14 @@ import styles from "./page.module.css"
|
|||||||
import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate"
|
import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function DetailsPage({
|
export default async function DetailsPage(
|
||||||
params: { lang },
|
props: PageArgs<LangParams, SelectRateSearchParams>
|
||||||
searchParams,
|
) {
|
||||||
}: PageArgs<LangParams, SelectRateSearchParams>) {
|
const searchParams = await props.searchParams
|
||||||
|
const params = await props.params
|
||||||
|
|
||||||
|
const { lang } = params
|
||||||
|
|
||||||
const selectRoomParams = new URLSearchParams(searchParams)
|
const selectRoomParams = new URLSearchParams(searchParams)
|
||||||
|
|
||||||
const { errorCode, ...booking } =
|
const { errorCode, ...booking } =
|
||||||
@@ -44,7 +48,7 @@ export default async function DetailsPage({
|
|||||||
booking.bookingCode &&
|
booking.bookingCode &&
|
||||||
FamilyAndFriendsCodes.includes(booking.bookingCode)
|
FamilyAndFriendsCodes.includes(booking.bookingCode)
|
||||||
) {
|
) {
|
||||||
const cookieStore = cookies()
|
const cookieStore = await cookies()
|
||||||
const isInValidFNF = cookieStore.get("sc")?.value !== "1"
|
const isInValidFNF = cookieStore.get("sc")?.value !== "1"
|
||||||
|
|
||||||
if (isInValidFNF) {
|
if (isInValidFNF) {
|
||||||
|
|||||||
@@ -8,7 +8,11 @@ import {
|
|||||||
} from "@/types/components/tracking"
|
} from "@/types/components/tracking"
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default function HotelReservationPage({ params }: PageArgs<LangParams>) {
|
export default async function HotelReservationPage(
|
||||||
|
props: PageArgs<LangParams>
|
||||||
|
) {
|
||||||
|
const params = await props.params
|
||||||
|
|
||||||
const pageTrackingData: TrackingSDKPageData = {
|
const pageTrackingData: TrackingSDKPageData = {
|
||||||
pageId: "hotelreservation",
|
pageId: "hotelreservation",
|
||||||
domainLanguage: params.lang,
|
domainLanguage: params.lang,
|
||||||
|
|||||||
@@ -4,17 +4,22 @@ import { Suspense } from "react"
|
|||||||
import { SelectHotelMapContainer } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer"
|
import { SelectHotelMapContainer } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer"
|
||||||
import { SelectHotelMapContainerSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainerSkeleton"
|
import { SelectHotelMapContainerSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainerSkeleton"
|
||||||
import { MapContainer } from "@/components/MapContainer"
|
import { MapContainer } from "@/components/MapContainer"
|
||||||
|
import { convertSearchParamsToObj } from "@/utils/url"
|
||||||
|
|
||||||
import styles from "./page.module.css"
|
import styles from "./page.module.css"
|
||||||
|
|
||||||
import type { SelectHotelSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams"
|
import type { SelectHotelSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams"
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function SelectHotelMapPage({
|
export default async function SelectHotelMapPage(
|
||||||
searchParams,
|
props: PageArgs<LangParams, SelectHotelSearchParams>
|
||||||
}: PageArgs<LangParams, SelectHotelSearchParams>) {
|
) {
|
||||||
|
const searchParams = await props.searchParams
|
||||||
const suspenseKey = stringify(searchParams)
|
const suspenseKey = stringify(searchParams)
|
||||||
|
|
||||||
|
const booking =
|
||||||
|
convertSearchParamsToObj<SelectHotelSearchParams>(searchParams)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.main}>
|
<div className={styles.main}>
|
||||||
<MapContainer>
|
<MapContainer>
|
||||||
@@ -22,7 +27,7 @@ export default async function SelectHotelMapPage({
|
|||||||
key={suspenseKey}
|
key={suspenseKey}
|
||||||
fallback={<SelectHotelMapContainerSkeleton />}
|
fallback={<SelectHotelMapContainerSkeleton />}
|
||||||
>
|
>
|
||||||
<SelectHotelMapContainer searchParams={searchParams} />
|
<SelectHotelMapContainer booking={booking} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</MapContainer>
|
</MapContainer>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,18 +11,22 @@ import SelectHotel from "@/components/HotelReservation/SelectHotel"
|
|||||||
import { getHotels } from "@/components/HotelReservation/SelectHotel/helpers"
|
import { getHotels } from "@/components/HotelReservation/SelectHotel/helpers"
|
||||||
import { getTracking } from "@/components/HotelReservation/SelectHotel/tracking"
|
import { getTracking } from "@/components/HotelReservation/SelectHotel/tracking"
|
||||||
import TrackingSDK from "@/components/TrackingSDK"
|
import TrackingSDK from "@/components/TrackingSDK"
|
||||||
import { setLang } from "@/i18n/serverContext"
|
|
||||||
import { getHotelSearchDetails } from "@/utils/hotelSearchDetails"
|
import { getHotelSearchDetails } from "@/utils/hotelSearchDetails"
|
||||||
|
import { convertSearchParamsToObj } from "@/utils/url"
|
||||||
|
|
||||||
import type { SelectHotelSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams"
|
import type { SelectHotelSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams"
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function SelectHotelPage({
|
export default async function SelectHotelPage(
|
||||||
params,
|
props: PageArgs<LangParams, SelectHotelSearchParams>
|
||||||
searchParams,
|
) {
|
||||||
}: PageArgs<LangParams, SelectHotelSearchParams>) {
|
const searchParams = await props.searchParams
|
||||||
setLang(params.lang)
|
const params = await props.params
|
||||||
const searchDetails = await getHotelSearchDetails({ searchParams })
|
|
||||||
|
const booking =
|
||||||
|
convertSearchParamsToObj<SelectHotelSearchParams>(searchParams)
|
||||||
|
|
||||||
|
const searchDetails = await getHotelSearchDetails(booking)
|
||||||
|
|
||||||
if (!searchDetails || !searchDetails.city) return notFound()
|
if (!searchDetails || !searchDetails.city) return notFound()
|
||||||
|
|
||||||
@@ -37,7 +41,7 @@ export default async function SelectHotelPage({
|
|||||||
} = searchDetails
|
} = searchDetails
|
||||||
|
|
||||||
if (bookingCode && FamilyAndFriendsCodes.includes(bookingCode)) {
|
if (bookingCode && FamilyAndFriendsCodes.includes(bookingCode)) {
|
||||||
const cookieStore = cookies()
|
const cookieStore = await cookies()
|
||||||
const isInvalidFNF = cookieStore.get("sc")?.value !== "1"
|
const isInvalidFNF = cookieStore.get("sc")?.value !== "1"
|
||||||
|
|
||||||
if (isInvalidFNF) {
|
if (isInvalidFNF) {
|
||||||
|
|||||||
@@ -13,10 +13,11 @@ const singleRoomRateTypes = combineRegExps(
|
|||||||
"i"
|
"i"
|
||||||
)
|
)
|
||||||
|
|
||||||
export default async function SelectRatePage({
|
export default async function SelectRatePage(
|
||||||
params,
|
props: PageArgs<LangParams & { section: string }, SelectRateSearchParams>
|
||||||
searchParams,
|
) {
|
||||||
}: PageArgs<LangParams & { section: string }, SelectRateSearchParams>) {
|
const params = await props.params
|
||||||
|
const searchParams = await props.searchParams
|
||||||
const booking = convertSearchParamsToObj<SelectRateSearchParams>(searchParams)
|
const booking = convertSearchParamsToObj<SelectRateSearchParams>(searchParams)
|
||||||
|
|
||||||
const isMultiRoom = booking.rooms.length > 1
|
const isMultiRoom = booking.rooms.length > 1
|
||||||
@@ -35,5 +36,5 @@ export default async function SelectRatePage({
|
|||||||
delete searchParams.bookingCode
|
delete searchParams.bookingCode
|
||||||
}
|
}
|
||||||
|
|
||||||
return <SelectRate params={params} searchParams={searchParams} />
|
return <SelectRate lang={params.lang} booking={booking} />
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ import { env } from "@/env/server"
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export async function generateMetadata({ params }: PageArgs<LangParams>) {
|
export async function generateMetadata(props: PageArgs<LangParams>) {
|
||||||
|
const params = await props.params;
|
||||||
return {
|
return {
|
||||||
robots: {
|
robots: {
|
||||||
index: env.isLangLive(params.lang),
|
index: env.isLangLive(params.lang),
|
||||||
|
|||||||
@@ -47,10 +47,11 @@ import type { LangParams, PageArgs } from "@/types/params"
|
|||||||
import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation"
|
import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation"
|
||||||
import type { SafeUser } from "@/types/user"
|
import type { SafeUser } from "@/types/user"
|
||||||
|
|
||||||
export default async function MyStay({
|
export default async function MyStay(
|
||||||
params,
|
props: PageArgs<LangParams, { RefId?: string }>
|
||||||
searchParams,
|
) {
|
||||||
}: PageArgs<LangParams, { RefId?: string }>) {
|
const searchParams = await props.searchParams
|
||||||
|
const params = await props.params
|
||||||
setLang(params.lang)
|
setLang(params.lang)
|
||||||
const refId = searchParams.RefId
|
const refId = searchParams.RefId
|
||||||
|
|
||||||
@@ -65,7 +66,8 @@ export default async function MyStay({
|
|||||||
|
|
||||||
const isLoggedIn = await isLoggedInUser()
|
const isLoggedIn = await isLoggedInUser()
|
||||||
|
|
||||||
const bv = cookies().get("bv")?.value
|
const cookieStore = await cookies()
|
||||||
|
const bv = cookieStore.get("bv")?.value
|
||||||
let bookingConfirmation
|
let bookingConfirmation
|
||||||
if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
bookingConfirmation = await getBookingConfirmation(refId)
|
bookingConfirmation = await getBookingConfirmation(refId)
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import {
|
|||||||
type TrackingSDKPageData,
|
type TrackingSDKPageData,
|
||||||
} from "@/types/components/tracking"
|
} from "@/types/components/tracking"
|
||||||
|
|
||||||
export default function Tracking() {
|
export default async function Tracking() {
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
|
|
||||||
const pageTrackingData: TrackingSDKPageData = {
|
const pageTrackingData: TrackingSDKPageData = {
|
||||||
channel: TrackingChannelEnum.hotels,
|
channel: TrackingChannelEnum.hotels,
|
||||||
|
|||||||
@@ -10,8 +10,9 @@ import { signIn } from "@/auth"
|
|||||||
|
|
||||||
export async function GET(
|
export async function GET(
|
||||||
request: NextRequest,
|
request: NextRequest,
|
||||||
context: { params: { lang: Lang } }
|
context: { params: Promise<{ lang: Lang }> }
|
||||||
) {
|
) {
|
||||||
|
const contextParams = await context.params
|
||||||
const publicURL = getPublicURL(request)
|
const publicURL = getPublicURL(request)
|
||||||
|
|
||||||
let redirectHeaders: Headers | undefined = undefined
|
let redirectHeaders: Headers | undefined = undefined
|
||||||
@@ -67,7 +68,7 @@ export async function GET(
|
|||||||
try {
|
try {
|
||||||
// Initiate the seamless login flow
|
// Initiate the seamless login flow
|
||||||
let redirectUrlValue
|
let redirectUrlValue
|
||||||
switch (context.params.lang) {
|
switch (contextParams.lang) {
|
||||||
case Lang.da:
|
case Lang.da:
|
||||||
redirectUrlValue = env.SEAMLESS_LOGIN_DA
|
redirectUrlValue = env.SEAMLESS_LOGIN_DA
|
||||||
break
|
break
|
||||||
@@ -115,7 +116,7 @@ export async function GET(
|
|||||||
|
|
||||||
/** Record<string, any> is next-auth typings */
|
/** Record<string, any> is next-auth typings */
|
||||||
const params: Record<string, any> = {
|
const params: Record<string, any> = {
|
||||||
ui_locales: context.params.lang,
|
ui_locales: contextParams.lang,
|
||||||
scope: [
|
scope: [
|
||||||
"openid",
|
"openid",
|
||||||
"profile",
|
"profile",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import type { Lang } from "@/constants/languages"
|
|||||||
|
|
||||||
export async function GET(
|
export async function GET(
|
||||||
request: NextRequest,
|
request: NextRequest,
|
||||||
context: { params: { lang: Lang } }
|
context: { params: Promise<{ lang: Lang }> }
|
||||||
) {
|
) {
|
||||||
const publicURL = getPublicURL(request)
|
const publicURL = getPublicURL(request)
|
||||||
|
|
||||||
@@ -52,6 +52,7 @@ export async function GET(
|
|||||||
try {
|
try {
|
||||||
console.log(`[verifymagiclink] final redirectUrl: ${redirectTo}`)
|
console.log(`[verifymagiclink] final redirectUrl: ${redirectTo}`)
|
||||||
|
|
||||||
|
const params = await context.params
|
||||||
/**
|
/**
|
||||||
* Passing `redirect: false` to `signIn` will return the URL instead of
|
* Passing `redirect: false` to `signIn` will return the URL instead of
|
||||||
* automatically redirecting to it inside of `signIn`.
|
* automatically redirecting to it inside of `signIn`.
|
||||||
@@ -64,7 +65,7 @@ export async function GET(
|
|||||||
redirect: false,
|
redirect: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ui_locales: context.params.lang,
|
ui_locales: params.lang,
|
||||||
scope: [
|
scope: [
|
||||||
"openid",
|
"openid",
|
||||||
"profile",
|
"profile",
|
||||||
|
|||||||
@@ -6,9 +6,8 @@ import { BookingWidget } from "@/components/BookingWidget"
|
|||||||
import type { BookingWidgetSearchData } from "@/types/components/bookingWidget"
|
import type { BookingWidgetSearchData } from "@/types/components/bookingWidget"
|
||||||
import type { PageArgs } from "@/types/params"
|
import type { PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function BookingWidgetDestinationCityPage({
|
export default async function BookingWidgetDestinationCityPage(props: PageArgs<{}, BookingWidgetSearchData>) {
|
||||||
searchParams,
|
const searchParams = await props.searchParams;
|
||||||
}: PageArgs<{}, BookingWidgetSearchData>) {
|
|
||||||
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
|
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ import { getLang } from "@/i18n/serverContext"
|
|||||||
import type { BookingWidgetSearchData } from "@/types/components/bookingWidget"
|
import type { BookingWidgetSearchData } from "@/types/components/bookingWidget"
|
||||||
import type { PageArgs } from "@/types/params"
|
import type { PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function BookingWidgetHotelPage({
|
export default async function BookingWidgetHotelPage(
|
||||||
searchParams,
|
props: PageArgs<{}, BookingWidgetSearchData & { subpage?: string }>
|
||||||
}: PageArgs<{}, BookingWidgetSearchData & { subpage?: string }>) {
|
) {
|
||||||
|
const searchParams = await props.searchParams
|
||||||
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
|
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@@ -19,7 +20,7 @@ export default async function BookingWidgetHotelPage({
|
|||||||
const hotelPageData = await getHotelPage()
|
const hotelPageData = await getHotelPage()
|
||||||
const hotelData = await getHotel({
|
const hotelData = await getHotel({
|
||||||
hotelId: hotelPageData?.hotel_page_id || "",
|
hotelId: hotelPageData?.hotel_page_id || "",
|
||||||
language: getLang(),
|
language: await getLang(),
|
||||||
isCardOnlyPayment: false,
|
isCardOnlyPayment: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ import { BookingWidget } from "@/components/BookingWidget"
|
|||||||
import type { BookingWidgetSearchData } from "@/types/components/bookingWidget"
|
import type { BookingWidgetSearchData } from "@/types/components/bookingWidget"
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function BookingWidgetPage({
|
export default async function BookingWidgetPage(
|
||||||
searchParams,
|
props: PageArgs<LangParams, BookingWidgetSearchData>
|
||||||
}: PageArgs<LangParams, BookingWidgetSearchData>) {
|
) {
|
||||||
|
const searchParams = await props.searchParams
|
||||||
|
|
||||||
return <BookingWidget bookingWidgetSearchParams={searchParams} />
|
return <BookingWidget bookingWidgetSearchParams={searchParams} />
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,9 @@ import { BookingWidget } from "@/components/BookingWidget"
|
|||||||
import type { BookingWidgetSearchData } from "@/types/components/bookingWidget"
|
import type { BookingWidgetSearchData } from "@/types/components/bookingWidget"
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function BookingWidgetPage({
|
export default async function BookingWidgetPage(props: PageArgs<LangParams, BookingWidgetSearchData>) {
|
||||||
searchParams,
|
const params = await props.params;
|
||||||
params,
|
const searchParams = await props.searchParams;
|
||||||
}: PageArgs<LangParams, BookingWidgetSearchData>) {
|
|
||||||
if (!env.isLangLive(params.lang)) {
|
if (!env.isLangLive(params.lang)) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default function Error({
|
|||||||
const params = useParams<LangParams>()
|
const params = useParams<LangParams>()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const searchParams = useSearchParams()
|
const searchParams = useSearchParams()
|
||||||
const currentSearchParamsRef = useRef<string>()
|
const currentSearchParamsRef = useRef<string>(undefined)
|
||||||
const isFirstLoadRef = useRef<boolean>(true)
|
const isFirstLoadRef = useRef<boolean>(true)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -27,15 +27,20 @@ import { setLang } from "@/i18n/serverContext"
|
|||||||
|
|
||||||
import type { LangParams, LayoutArgs } from "@/types/params"
|
import type { LangParams, LayoutArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function RootLayout({
|
export default async function RootLayout(
|
||||||
bookingwidget,
|
props: React.PropsWithChildren<
|
||||||
children,
|
|
||||||
params,
|
|
||||||
}: React.PropsWithChildren<
|
|
||||||
LayoutArgs<LangParams> & {
|
LayoutArgs<LangParams> & {
|
||||||
bookingwidget: React.ReactNode
|
bookingwidget: React.ReactNode
|
||||||
}
|
}
|
||||||
>) {
|
>
|
||||||
|
) {
|
||||||
|
const params = await props.params;
|
||||||
|
|
||||||
|
const {
|
||||||
|
bookingwidget,
|
||||||
|
children
|
||||||
|
} = props;
|
||||||
|
|
||||||
setLang(params.lang)
|
setLang(params.lang)
|
||||||
const messages = await getMessages(params.lang)
|
const messages = await getMessages(params.lang)
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,11 @@ import styles from "./page.module.css"
|
|||||||
|
|
||||||
import type { LangParams, LayoutArgs, StatusParams } from "@/types/params"
|
import type { LangParams, LayoutArgs, StatusParams } from "@/types/params"
|
||||||
|
|
||||||
export default async function MiddlewareError({
|
export default async function MiddlewareError(props: LayoutArgs<LangParams & StatusParams>) {
|
||||||
params,
|
const params = await props.params;
|
||||||
}: LayoutArgs<LangParams & StatusParams>) {
|
|
||||||
return (
|
return (
|
||||||
// eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
// eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
||||||
<div className={styles.layout}>
|
<div className={styles.layout}>Middleware error {params.lang} {params.status}
|
||||||
Middleware error {params.lang} {params.status}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,9 @@ import type { LangParams, PageArgs, UriParams } from "@/types/params"
|
|||||||
import type { GetCurrentBlockPageData } from "@/types/requests/currentBlockPage"
|
import type { GetCurrentBlockPageData } from "@/types/requests/currentBlockPage"
|
||||||
import type { TrackingData } from "@/types/requests/trackingData"
|
import type { TrackingData } from "@/types/requests/trackingData"
|
||||||
|
|
||||||
export default async function CurrentContentPage({
|
export default async function CurrentContentPage(props: PageArgs<LangParams, UriParams>) {
|
||||||
params,
|
const searchParams = await props.searchParams;
|
||||||
searchParams,
|
const params = await props.params;
|
||||||
}: PageArgs<LangParams, UriParams>) {
|
|
||||||
try {
|
try {
|
||||||
if (!searchParams.uri) {
|
if (!searchParams.uri) {
|
||||||
throw new Error("Bad URI")
|
throw new Error("Bad URI")
|
||||||
|
|||||||
@@ -30,13 +30,18 @@ export const metadata: Metadata = {
|
|||||||
title: "Scandic Hotels",
|
title: "Scandic Hotels",
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function RootLayout({
|
export default async function RootLayout(
|
||||||
children,
|
props: React.PropsWithChildren<
|
||||||
params,
|
|
||||||
header,
|
|
||||||
}: React.PropsWithChildren<
|
|
||||||
LayoutArgs<LangParams> & { header: React.ReactNode }
|
LayoutArgs<LangParams> & { header: React.ReactNode }
|
||||||
>) {
|
>
|
||||||
|
) {
|
||||||
|
const params = await props.params;
|
||||||
|
|
||||||
|
const {
|
||||||
|
children,
|
||||||
|
header
|
||||||
|
} = props;
|
||||||
|
|
||||||
setLang(params.lang)
|
setLang(params.lang)
|
||||||
const messages = await getMessages(params.lang)
|
const messages = await getMessages(params.lang)
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,8 @@ import { Receipt } from "@/components/HotelReservation/MyStay/Receipt"
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function ReceiptPage({
|
export default async function ReceiptPage(props: PageArgs<LangParams, { RefId?: string }>) {
|
||||||
searchParams,
|
const searchParams = await props.searchParams;
|
||||||
}: PageArgs<LangParams, { RefId?: string }>) {
|
|
||||||
if (!searchParams.RefId) {
|
if (!searchParams.RefId) {
|
||||||
notFound()
|
notFound()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,10 +23,13 @@ import { setLang } from "@/i18n/serverContext"
|
|||||||
|
|
||||||
import type { LangParams, LayoutArgs } from "@/types/params"
|
import type { LangParams, LayoutArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function RootLayout({
|
export default async function RootLayout(props: React.PropsWithChildren<LayoutArgs<LangParams>>) {
|
||||||
children,
|
const params = await props.params;
|
||||||
params,
|
|
||||||
}: React.PropsWithChildren<LayoutArgs<LangParams>>) {
|
const {
|
||||||
|
children
|
||||||
|
} = props;
|
||||||
|
|
||||||
setLang(params.lang)
|
setLang(params.lang)
|
||||||
const messages = await getMessages(params.lang)
|
const messages = await getMessages(params.lang)
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,9 @@ const tokenResponseSchema = z.object({
|
|||||||
|
|
||||||
export async function GET(
|
export async function GET(
|
||||||
request: NextRequest,
|
request: NextRequest,
|
||||||
{ params }: { params: { lang: string } }
|
props: { params: Promise<{ lang: string }> }
|
||||||
) {
|
) {
|
||||||
|
const params = await props.params
|
||||||
const { lang } = params
|
const { lang } = params
|
||||||
|
|
||||||
const result = searchParamsSchema.safeParse({
|
const result = searchParamsSchema.safeParse({
|
||||||
@@ -72,7 +73,7 @@ export async function GET(
|
|||||||
redirect(`/${lang}/sas-x-scandic/error?errorCode=invalid_state`)
|
redirect(`/${lang}/sas-x-scandic/error?errorCode=invalid_state`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const cookieStore = cookies()
|
const cookieStore = await cookies()
|
||||||
cookieStore.set(SAS_TOKEN_STORAGE_KEY, tokenData.access_token, {
|
cookieStore.set(SAS_TOKEN_STORAGE_KEY, tokenData.access_token, {
|
||||||
maxAge: 3600,
|
maxAge: 3600,
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
@@ -83,7 +84,8 @@ export async function GET(
|
|||||||
stateResult.data.intent === "unlink" ||
|
stateResult.data.intent === "unlink" ||
|
||||||
stateResult.data.intent === "transfer"
|
stateResult.data.intent === "transfer"
|
||||||
) {
|
) {
|
||||||
const [data, error] = await safeTry(serverClient().partner.sas.requestOtp())
|
const caller = await serverClient()
|
||||||
|
const [data, error] = await safeTry(caller.partner.sas.requestOtp())
|
||||||
if (!data || error) {
|
if (!data || error) {
|
||||||
console.error("[SAS] Failed to request OTP", error)
|
console.error("[SAS] Failed to request OTP", error)
|
||||||
redirect(`/${lang}/sas-x-scandic/error`)
|
redirect(`/${lang}/sas-x-scandic/error`)
|
||||||
|
|||||||
@@ -12,9 +12,10 @@ import { UnlinkError } from "../components/UnlinkError"
|
|||||||
|
|
||||||
import type { LangParams, PageArgs, SearchParams } from "@/types/params"
|
import type { LangParams, PageArgs, SearchParams } from "@/types/params"
|
||||||
|
|
||||||
export default async function Page({
|
export default async function Page(
|
||||||
searchParams,
|
props: PageArgs<LangParams> & SearchParams<{ errorCode?: "dateOfBirthMismatch" }>
|
||||||
}: PageArgs<LangParams> & SearchParams<{ errorCode?: "dateOfBirthMismatch" }>) {
|
) {
|
||||||
|
const searchParams = await props.searchParams;
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
|
|
||||||
const { errorCode } = searchParams
|
const { errorCode } = searchParams
|
||||||
|
|||||||
@@ -13,10 +13,13 @@ import type { PropsWithChildren } from "react"
|
|||||||
|
|
||||||
import type { LangParams, LayoutArgs } from "@/types/params"
|
import type { LangParams, LayoutArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function SasXScandicLayout({
|
export default async function SasXScandicLayout(props: PropsWithChildren<LayoutArgs<LangParams>>) {
|
||||||
children,
|
const params = await props.params;
|
||||||
params,
|
|
||||||
}: PropsWithChildren<LayoutArgs<LangParams>>) {
|
const {
|
||||||
|
children
|
||||||
|
} = props;
|
||||||
|
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -10,9 +10,8 @@ import { LinkAccountForm } from "./LinkAccountForm"
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function SASxScandicLinkPage({
|
export default async function SASxScandicLinkPage(props: PageArgs<LangParams>) {
|
||||||
params,
|
const params = await props.params;
|
||||||
}: PageArgs<LangParams>) {
|
|
||||||
const profile = await getProfileSafely()
|
const profile = await getProfileSafely()
|
||||||
|
|
||||||
if (!profile || !profile.loyalty) return null
|
if (!profile || !profile.loyalty) return null
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ import { SASModal } from "../../components/SASModal"
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function SASxScandicLinkPage({
|
export default async function SASxScandicLinkPage(props: PageArgs<LangParams>) {
|
||||||
params,
|
const params = await props.params;
|
||||||
}: PageArgs<LangParams>) {
|
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -24,10 +24,9 @@ const searchParamsSchema = z.object({
|
|||||||
|
|
||||||
type Intent = z.infer<typeof searchParamsSchema>["intent"]
|
type Intent = z.infer<typeof searchParamsSchema>["intent"]
|
||||||
|
|
||||||
export default async function SASxScandicLoginPage({
|
export default async function SASxScandicLoginPage(props: PageArgs<LangParams> & SearchParams) {
|
||||||
searchParams,
|
const params = await props.params;
|
||||||
params,
|
const searchParams = await props.searchParams;
|
||||||
}: PageArgs<LangParams> & SearchParams) {
|
|
||||||
const result = searchParamsSchema.safeParse(searchParams)
|
const result = searchParamsSchema.safeParse(searchParams)
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
// TOOD where to redirect?
|
// TOOD where to redirect?
|
||||||
|
|||||||
@@ -29,12 +29,13 @@ const searchParamsSchema = z.object({
|
|||||||
export type OtpError = z.infer<typeof otpError>
|
export type OtpError = z.infer<typeof otpError>
|
||||||
type Intent = z.infer<typeof intent>
|
type Intent = z.infer<typeof intent>
|
||||||
|
|
||||||
export default async function SASxScandicOneTimePasswordPage({
|
export default async function SASxScandicOneTimePasswordPage(
|
||||||
searchParams,
|
props: PageArgs<LangParams> & SearchParams
|
||||||
params,
|
) {
|
||||||
}: PageArgs<LangParams> & SearchParams) {
|
const params = await props.params
|
||||||
|
const searchParams = await props.searchParams
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const cookieStore = cookies()
|
const cookieStore = await cookies()
|
||||||
const tokenCookie = cookieStore.get(SAS_TOKEN_STORAGE_KEY)
|
const tokenCookie = cookieStore.get(SAS_TOKEN_STORAGE_KEY)
|
||||||
|
|
||||||
const result = searchParamsSchema.safeParse(searchParams)
|
const result = searchParamsSchema.safeParse(searchParams)
|
||||||
@@ -49,9 +50,8 @@ export default async function SASxScandicOneTimePasswordPage({
|
|||||||
|
|
||||||
const handleOtpVerified: OnSubmitHandler = async ({ otp }) => {
|
const handleOtpVerified: OnSubmitHandler = async ({ otp }) => {
|
||||||
"use server"
|
"use server"
|
||||||
const [data, error] = await safeTry(
|
const caller = await serverClient()
|
||||||
serverClient().partner.sas.verifyOtp({ otp })
|
const [data, error] = await safeTry(caller.partner.sas.verifyOtp({ otp }))
|
||||||
)
|
|
||||||
|
|
||||||
if (error || !data) {
|
if (error || !data) {
|
||||||
throw error || new Error("OTP verification failed")
|
throw error || new Error("OTP verification failed")
|
||||||
@@ -166,7 +166,8 @@ async function handleLinkAccount({
|
|||||||
}: {
|
}: {
|
||||||
lang: Lang
|
lang: Lang
|
||||||
}): ReturnType<OnSubmitHandler> {
|
}): ReturnType<OnSubmitHandler> {
|
||||||
const [res, error] = await safeTry(serverClient().partner.sas.linkAccount())
|
const caller = await serverClient()
|
||||||
|
const [res, error] = await safeTry(caller.partner.sas.linkAccount())
|
||||||
if (!res || error) {
|
if (!res || error) {
|
||||||
console.error("[SAS] link account error", error)
|
console.error("[SAS] link account error", error)
|
||||||
return {
|
return {
|
||||||
@@ -208,7 +209,8 @@ async function handleUnlinkAccount({
|
|||||||
}: {
|
}: {
|
||||||
lang: Lang
|
lang: Lang
|
||||||
}): ReturnType<OnSubmitHandler> {
|
}): ReturnType<OnSubmitHandler> {
|
||||||
const [res, error] = await safeTry(serverClient().partner.sas.unlinkAccount())
|
const caller = await serverClient()
|
||||||
|
const [res, error] = await safeTry(caller.partner.sas.unlinkAccount())
|
||||||
if (!res || error) {
|
if (!res || error) {
|
||||||
console.error("[SAS] unlink account error", error)
|
console.error("[SAS] unlink account error", error)
|
||||||
return {
|
return {
|
||||||
@@ -239,7 +241,7 @@ async function handleTransferPoints({
|
|||||||
}: {
|
}: {
|
||||||
lang: Lang
|
lang: Lang
|
||||||
}): ReturnType<OnSubmitHandler> {
|
}): ReturnType<OnSubmitHandler> {
|
||||||
const cookieStore = cookies()
|
const cookieStore = await cookies()
|
||||||
const pointsCookie = cookieStore.get(SAS_TRANSFER_POINT_KEY)
|
const pointsCookie = cookieStore.get(SAS_TRANSFER_POINT_KEY)
|
||||||
const points = Number(pointsCookie?.value)
|
const points = Number(pointsCookie?.value)
|
||||||
|
|
||||||
@@ -252,8 +254,9 @@ async function handleTransferPoints({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const caller = await serverClient()
|
||||||
const [res, error] = await safeTry(
|
const [res, error] = await safeTry(
|
||||||
serverClient().partner.sas.transferPoints({
|
caller.partner.sas.transferPoints({
|
||||||
points,
|
points,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,10 +20,9 @@ import styles from "./transferSuccess.module.css"
|
|||||||
import type { LangParams, PageArgs, SearchParams } from "@/types/params"
|
import type { LangParams, PageArgs, SearchParams } from "@/types/params"
|
||||||
import type { Lang } from "@/constants/languages"
|
import type { Lang } from "@/constants/languages"
|
||||||
|
|
||||||
export default async function SASxScandicTransferSuccessPage({
|
export default async function SASxScandicTransferSuccessPage(props: PageArgs<LangParams> & SearchParams<{ p?: string }>) {
|
||||||
params,
|
const searchParams = await props.searchParams;
|
||||||
searchParams,
|
const params = await props.params;
|
||||||
}: PageArgs<LangParams> & SearchParams<{ p?: string }>) {
|
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const { lang } = params
|
const { lang } = params
|
||||||
const addedPoints = Number(searchParams.p) || 0
|
const addedPoints = Number(searchParams.p) || 0
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ import { SASModal } from "../../components/SASModal"
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function SASxScandicUnlinkSuccessPage({
|
export default async function SASxScandicUnlinkSuccessPage(props: PageArgs<LangParams>) {
|
||||||
params,
|
const params = await props.params;
|
||||||
}: PageArgs<LangParams>) {
|
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -23,10 +23,13 @@ import { setLang } from "@/i18n/serverContext"
|
|||||||
|
|
||||||
import type { LangParams, LayoutArgs } from "@/types/params"
|
import type { LangParams, LayoutArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function RootLayout({
|
export default async function RootLayout(props: React.PropsWithChildren<LayoutArgs<LangParams>>) {
|
||||||
children,
|
const params = await props.params;
|
||||||
params,
|
|
||||||
}: React.PropsWithChildren<LayoutArgs<LangParams>>) {
|
const {
|
||||||
|
children
|
||||||
|
} = props;
|
||||||
|
|
||||||
if (!env.SAS_ENABLED) {
|
if (!env.SAS_ENABLED) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,10 @@ import type {
|
|||||||
UIDParams,
|
UIDParams,
|
||||||
} from "@/types/params"
|
} from "@/types/params"
|
||||||
|
|
||||||
export default async function ContentTypePage({
|
export default async function ContentTypePage(
|
||||||
params,
|
props: PageArgs<LangParams & ContentTypeWebviewParams & UIDParams, {}>
|
||||||
}: PageArgs<LangParams & ContentTypeWebviewParams & UIDParams, {}>) {
|
) {
|
||||||
|
const params = await props.params
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const user = await getProfile()
|
const user = await getProfile()
|
||||||
|
|
||||||
@@ -36,8 +37,8 @@ export default async function ContentTypePage({
|
|||||||
case "unauthorized": // fall through
|
case "unauthorized": // fall through
|
||||||
case "forbidden": // fall through
|
case "forbidden": // fall through
|
||||||
case "token_expired":
|
case "token_expired":
|
||||||
const h = headers()
|
const headersList = await headers()
|
||||||
const returnURL = `/${params.lang}/webview${h.get("x-pathname")!}`
|
const returnURL = `/${params.lang}/webview${headersList.get("x-pathname")!}`
|
||||||
const redirectURL = `/${params.lang}/webview/refresh?returnUrl=${encodeURIComponent(returnURL)}`
|
const redirectURL = `/${params.lang}/webview/refresh?returnUrl=${encodeURIComponent(returnURL)}`
|
||||||
console.log(`[webview:page] user error, redirecting to: ${redirectURL}`)
|
console.log(`[webview:page] user error, redirecting to: ${redirectURL}`)
|
||||||
redirect(redirectURL)
|
redirect(redirectURL)
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ import { env } from "@/env/server"
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export async function generateMetadata({ params }: PageArgs<LangParams>) {
|
export async function generateMetadata(props: PageArgs<LangParams>) {
|
||||||
|
const params = await props.params;
|
||||||
return {
|
return {
|
||||||
robots: {
|
robots: {
|
||||||
index: env.isLangLive(params.lang),
|
index: env.isLangLive(params.lang),
|
||||||
|
|||||||
@@ -47,10 +47,11 @@ import type { LangParams, PageArgs } from "@/types/params"
|
|||||||
import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation"
|
import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation"
|
||||||
import type { SafeUser } from "@/types/user"
|
import type { SafeUser } from "@/types/user"
|
||||||
|
|
||||||
export default async function MyStay({
|
export default async function MyStay(
|
||||||
params,
|
props: PageArgs<LangParams, { RefId?: string }>
|
||||||
searchParams,
|
) {
|
||||||
}: PageArgs<LangParams, { RefId?: string }>) {
|
const searchParams = await props.searchParams
|
||||||
|
const params = await props.params
|
||||||
setLang(params.lang)
|
setLang(params.lang)
|
||||||
const refId = searchParams.RefId
|
const refId = searchParams.RefId
|
||||||
|
|
||||||
@@ -66,7 +67,8 @@ export default async function MyStay({
|
|||||||
|
|
||||||
const isLoggedIn = await isLoggedInUser()
|
const isLoggedIn = await isLoggedInUser()
|
||||||
|
|
||||||
const bv = cookies().get("bv")?.value
|
const cookieStore = await cookies()
|
||||||
|
const bv = cookieStore.get("bv")?.value
|
||||||
let bookingConfirmation
|
let bookingConfirmation
|
||||||
if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
bookingConfirmation = await getBookingConfirmation(refId)
|
bookingConfirmation = await getBookingConfirmation(refId)
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import {
|
|||||||
type TrackingSDKPageData,
|
type TrackingSDKPageData,
|
||||||
} from "@/types/components/tracking"
|
} from "@/types/components/tracking"
|
||||||
|
|
||||||
export default function Tracking() {
|
export default async function Tracking() {
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
|
|
||||||
const pageTrackingData: TrackingSDKPageData = {
|
const pageTrackingData: TrackingSDKPageData = {
|
||||||
channel: TrackingChannelEnum.hotels,
|
channel: TrackingChannelEnum.hotels,
|
||||||
|
|||||||
@@ -26,10 +26,13 @@ export const metadata: Metadata = {
|
|||||||
title: "Webview",
|
title: "Webview",
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function RootLayout({
|
export default async function RootLayout(props: React.PropsWithChildren<LayoutArgs<LangParams>>) {
|
||||||
children,
|
const params = await props.params;
|
||||||
params,
|
|
||||||
}: React.PropsWithChildren<LayoutArgs<LangParams>>) {
|
const {
|
||||||
|
children
|
||||||
|
} = props;
|
||||||
|
|
||||||
setLang(params.lang)
|
setLang(params.lang)
|
||||||
const messages = await getMessages(params.lang)
|
const messages = await getMessages(params.lang)
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ export async function GET(request: NextRequest) {
|
|||||||
throw new Error("[WARMUP] Invalid language provided")
|
throw new Error("[WARMUP] Invalid language provided")
|
||||||
}
|
}
|
||||||
|
|
||||||
const hotels = await serverClient().hotel.hotels.getDestinationsMapData({
|
const caller = await serverClient()
|
||||||
|
const hotels = await caller.hotel.hotels.getDestinationsMapData({
|
||||||
lang: parsedLang.data,
|
lang: parsedLang.data,
|
||||||
warmup: true,
|
warmup: true,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ import type { NextRequest } from "next/server"
|
|||||||
|
|
||||||
export async function GET(
|
export async function GET(
|
||||||
request: NextRequest,
|
request: NextRequest,
|
||||||
{ params }: { params: { lang: string } }
|
props: { params: Promise<{ lang: string }> }
|
||||||
) {
|
) {
|
||||||
|
const params = await props.params
|
||||||
const publicURL = getPublicURL(request)
|
const publicURL = getPublicURL(request)
|
||||||
|
|
||||||
console.log(`[add-card] callback started`)
|
console.log(`[add-card] callback started`)
|
||||||
@@ -24,7 +25,8 @@ export async function GET(
|
|||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
if (trxId) {
|
if (trxId) {
|
||||||
const saveCardSuccess = await serverClient().user.creditCard.save({
|
const caller = await serverClient()
|
||||||
|
const saveCardSuccess = await caller.user.creditCard.save({
|
||||||
transactionId: trxId,
|
transactionId: trxId,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const validateJsonBody = z.object({
|
|||||||
|
|
||||||
export async function POST(request: NextRequest) {
|
export async function POST(request: NextRequest) {
|
||||||
try {
|
try {
|
||||||
const headersList = headers()
|
const headersList = await headers()
|
||||||
const secret = headersList.get("x-revalidate-secret")
|
const secret = headersList.get("x-revalidate-secret")
|
||||||
|
|
||||||
if (secret !== env.REVALIDATE_SECRET) {
|
if (secret !== env.REVALIDATE_SECRET) {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const validateJsonBody = z.object({
|
|||||||
|
|
||||||
export async function POST(request: NextRequest) {
|
export async function POST(request: NextRequest) {
|
||||||
try {
|
try {
|
||||||
const headersList = headers()
|
const headersList = await headers()
|
||||||
const secret = headersList.get("x-revalidate-secret")
|
const secret = headersList.get("x-revalidate-secret")
|
||||||
|
|
||||||
if (secret !== env.REVALIDATE_SECRET) {
|
if (secret !== env.REVALIDATE_SECRET) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import type { Lang } from "@/constants/languages"
|
|||||||
// purging your cache for new (and old) requests
|
// purging your cache for new (and old) requests
|
||||||
export async function POST() {
|
export async function POST() {
|
||||||
try {
|
try {
|
||||||
const headersList = headers()
|
const headersList = await headers()
|
||||||
const secret = headersList.get("x-revalidate-secret")
|
const secret = headersList.get("x-revalidate-secret")
|
||||||
|
|
||||||
if (secret !== env.REVALIDATE_SECRET) {
|
if (secret !== env.REVALIDATE_SECRET) {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const validateJsonBody = z.object({
|
|||||||
|
|
||||||
export async function POST(request: NextRequest) {
|
export async function POST(request: NextRequest) {
|
||||||
try {
|
try {
|
||||||
const headersList = headers()
|
const headersList = await headers()
|
||||||
const secret = headersList.get("x-revalidate-secret")
|
const secret = headersList.get("x-revalidate-secret")
|
||||||
|
|
||||||
if (secret !== env.REVALIDATE_SECRET) {
|
if (secret !== env.REVALIDATE_SECRET) {
|
||||||
|
|||||||
@@ -10,13 +10,14 @@ export const dynamic = "force-dynamic"
|
|||||||
|
|
||||||
export async function GET(
|
export async function GET(
|
||||||
_request: NextRequest,
|
_request: NextRequest,
|
||||||
context: { params: { sitemapId: string } }
|
context: { params: Promise<{ sitemapId: string }> }
|
||||||
) {
|
) {
|
||||||
if (env.NEW_SITE_LIVE_STATUS !== "ALL_LANGUAGES_LIVE") {
|
if (env.NEW_SITE_LIVE_STATUS !== "ALL_LANGUAGES_LIVE") {
|
||||||
return notFound()
|
return notFound()
|
||||||
}
|
}
|
||||||
|
|
||||||
const sitemapId = context.params.sitemapId
|
const params = await context.params
|
||||||
|
const sitemapId = params.sitemapId
|
||||||
|
|
||||||
console.log("[SITEMAP] Fetching sitemap by ID", sitemapId)
|
console.log("[SITEMAP] Fetching sitemap by ID", sitemapId)
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export function SessionRefresher() {
|
|||||||
const session = useSession()
|
const session = useSession()
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
const searchParams = useSearchParams()
|
const searchParams = useSearchParams()
|
||||||
const timeoutId = useRef<ReturnType<typeof setTimeout>>()
|
const timeoutId = useRef<ReturnType<typeof setTimeout>>(undefined)
|
||||||
|
|
||||||
// Simple inactivity control. Reset when the URL changes.
|
// Simple inactivity control. Reset when the URL changes.
|
||||||
const stopPreRefreshAt = useMemo(
|
const stopPreRefreshAt = useMemo(
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ import type { LevelCardProps } from "@/types/components/overviewTable"
|
|||||||
export default async function LoyaltyLevels({
|
export default async function LoyaltyLevels({
|
||||||
dynamic_content,
|
dynamic_content,
|
||||||
}: LoyaltyLevelsProps) {
|
}: LoyaltyLevelsProps) {
|
||||||
const uniqueLevels = await serverClient().contentstack.rewards.all({
|
const caller = await serverClient()
|
||||||
|
const uniqueLevels = await caller.contentstack.rewards.all({
|
||||||
unique: true,
|
unique: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ export default async function ExpiringPoints({ user }: UserProps) {
|
|||||||
}
|
}
|
||||||
const d = dt(membership.pointsExpiryDate)
|
const d = dt(membership.pointsExpiryDate)
|
||||||
|
|
||||||
const dateFormat = getLang() == Lang.fi ? "DD.MM.YYYY" : "YYYY-MM-DD"
|
const lang = await getLang()
|
||||||
|
const dateFormat = lang == Lang.fi ? "DD.MM.YYYY" : "YYYY-MM-DD"
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
|
|||||||
@@ -14,9 +14,10 @@ export default async function Points({ user }: UserProps) {
|
|||||||
|
|
||||||
const membership = user.loyalty ? getFriendsMembership(user.loyalty) : null
|
const membership = user.loyalty ? getFriendsMembership(user.loyalty) : null
|
||||||
|
|
||||||
|
const caller = await serverClient()
|
||||||
const nextLevel =
|
const nextLevel =
|
||||||
membership?.nextLevel && MembershipLevelEnum[membership.nextLevel]
|
membership?.nextLevel && MembershipLevelEnum[membership.nextLevel]
|
||||||
? await serverClient().contentstack.loyaltyLevels.byLevel({
|
? await caller.contentstack.loyaltyLevels.byLevel({
|
||||||
level: MembershipLevelEnum[membership.nextLevel],
|
level: MembershipLevelEnum[membership.nextLevel],
|
||||||
})
|
})
|
||||||
: null
|
: null
|
||||||
|
|||||||
@@ -9,8 +9,9 @@ import type { OverviewTableProps } from "@/types/components/blocks/dynamicConten
|
|||||||
export default async function OverviewTable({
|
export default async function OverviewTable({
|
||||||
dynamic_content,
|
dynamic_content,
|
||||||
}: OverviewTableProps) {
|
}: OverviewTableProps) {
|
||||||
|
const caller = await serverClient()
|
||||||
const [levels, membershipLevel] = await Promise.all([
|
const [levels, membershipLevel] = await Promise.all([
|
||||||
serverClient().contentstack.rewards.all(),
|
caller.contentstack.rewards.all(),
|
||||||
getMembershipLevelSafely(),
|
getMembershipLevelSafely(),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ export default async function NextLevelRewardsBlock({
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const nextLevelRewards = await serverClient().contentstack.rewards.byLevel({
|
const caller = await serverClient()
|
||||||
|
const nextLevelRewards = await caller.contentstack.rewards.byLevel({
|
||||||
level_id: MembershipLevelEnum[membershipLevel?.nextLevel],
|
level_id: MembershipLevelEnum[membershipLevel?.nextLevel],
|
||||||
unique: true,
|
unique: true,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default async function SASTransferPoints({
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SectionContainer>
|
<SectionContainer>
|
||||||
|
|||||||
@@ -10,8 +10,9 @@ export default async function SASTierComparisonBlock({
|
|||||||
title,
|
title,
|
||||||
preamble,
|
preamble,
|
||||||
}: SASTierComparisonBlockProps) {
|
}: SASTierComparisonBlockProps) {
|
||||||
|
const caller = await serverClient()
|
||||||
const tierComparison =
|
const tierComparison =
|
||||||
await serverClient().contentstack.partner.getSasTierComparison()
|
await caller.contentstack.partner.getSasTierComparison()
|
||||||
|
|
||||||
if (!tierComparison) return null
|
if (!tierComparison) return null
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ export default async function PreviousStays({
|
|||||||
subtitle,
|
subtitle,
|
||||||
link,
|
link,
|
||||||
}: AccountPageComponentProps) {
|
}: AccountPageComponentProps) {
|
||||||
const initialPreviousStays = await serverClient().user.stays.previous({
|
const caller = await serverClient()
|
||||||
|
const initialPreviousStays = await caller.user.stays.previous({
|
||||||
limit: 6,
|
limit: 6,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import styles from "./emptyUpcomingStays.module.css"
|
|||||||
|
|
||||||
export default async function EmptyUpcomingStaysBlock() {
|
export default async function EmptyUpcomingStaysBlock() {
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com"
|
const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com"
|
||||||
|
|
||||||
const href = !env.isLangLive(lang)
|
const href = !env.isLangLive(lang)
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ export default async function SoonestStays({
|
|||||||
subtitle,
|
subtitle,
|
||||||
link,
|
link,
|
||||||
}: AccountPageComponentProps) {
|
}: AccountPageComponentProps) {
|
||||||
const upcomingStays = await serverClient().user.stays.upcoming({ limit: 3 })
|
const caller = await serverClient()
|
||||||
|
const upcomingStays = await caller.user.stays.upcoming({ limit: 3 })
|
||||||
if (!upcomingStays?.data) {
|
if (!upcomingStays?.data) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import styles from "./emptyUpcomingStays.module.css"
|
|||||||
|
|
||||||
export default async function EmptyUpcomingStaysBlock() {
|
export default async function EmptyUpcomingStaysBlock() {
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com"
|
const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com"
|
||||||
|
|
||||||
const href = !env.isLangLive(lang)
|
const href = !env.isLangLive(lang)
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ export default async function UpcomingStays({
|
|||||||
subtitle,
|
subtitle,
|
||||||
link,
|
link,
|
||||||
}: AccountPageComponentProps) {
|
}: AccountPageComponentProps) {
|
||||||
const initialUpcomingStays = await serverClient().user.stays.upcoming({
|
const caller = await serverClient()
|
||||||
|
const initialUpcomingStays = await caller.user.stays.upcoming({
|
||||||
limit: 6,
|
limit: 6,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ export default async function Breadcrumbs({
|
|||||||
size,
|
size,
|
||||||
subpageTitle,
|
subpageTitle,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const breadcrumbs = await serverClient().contentstack.breadcrumbs.get()
|
const caller = await serverClient()
|
||||||
|
const breadcrumbs = await caller.contentstack.breadcrumbs.get()
|
||||||
if (!breadcrumbs?.length) {
|
if (!breadcrumbs?.length) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ interface HotelMapPageProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default async function HotelMapPage({ hotelId }: HotelMapPageProps) {
|
export default async function HotelMapPage({ hotelId }: HotelMapPageProps) {
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const hotelPageData = await getHotelPage()
|
const hotelPageData = await getHotelPage()
|
||||||
const hotelData = await getHotel({
|
const hotelData = await getHotel({
|
||||||
hotelId,
|
hotelId,
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export default async function TripAdvisorLink({
|
|||||||
|
|
||||||
const hasTripAdvisorIframeSrc = !!reviews.widgetScriptEmbedUrlIframe
|
const hasTripAdvisorIframeSrc = !!reviews.widgetScriptEmbedUrlIframe
|
||||||
const tripAdvisorHref = hasTripAdvisorIframeSrc
|
const tripAdvisorHref = hasTripAdvisorIframeSrc
|
||||||
? appendSlugToPathname("reviews")
|
? await appendSlugToPathname("reviews")
|
||||||
: null
|
: null
|
||||||
|
|
||||||
if (!tripAdvisorHref) {
|
if (!tripAdvisorHref) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default async function ContactInformation({
|
|||||||
ecoLabels,
|
ecoLabels,
|
||||||
}: ContactInformationProps) {
|
}: ContactInformationProps) {
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const { latitude, longitude } = coordinates
|
const { latitude, longitude } = coordinates
|
||||||
const directionsUrl = `https://www.google.com/maps/dir/?api=1&destination=${latitude},${longitude}`
|
const directionsUrl = `https://www.google.com/maps/dir/?api=1&destination=${latitude},${longitude}`
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ export default async function AmenitiesSidePeek({
|
|||||||
}: AmenitiesSidePeekProps) {
|
}: AmenitiesSidePeekProps) {
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
|
|
||||||
const parkingPageHref = appendSlugToPathname(parking.parkingPageUrl)
|
const parkingPageHref = await appendSlugToPathname(parking.parkingPageUrl)
|
||||||
const accessibilityPageHref = appendSlugToPathname(
|
const accessibilityPageHref = await appendSlugToPathname(
|
||||||
accessibility.accessibilityPageUrl
|
accessibility.accessibilityPageUrl
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default async function MeetingsAndConferencesSidePeek({
|
|||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const { seatingText, roomText } = await getConferenceRoomTexts(meetingRooms)
|
const { seatingText, roomText } = await getConferenceRoomTexts(meetingRooms)
|
||||||
const visibleImages = meetingFacilities?.heroImages.slice(0, 2)
|
const visibleImages = meetingFacilities?.heroImages.slice(0, 2)
|
||||||
const meetingPageHref = appendSlugToPathname(meetingPageUrl)
|
const meetingPageHref = await appendSlugToPathname(meetingPageUrl)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidePeek
|
<SidePeek
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default async function RestaurantBarItem({
|
|||||||
const visibleImages = restaurant.content.images.slice(0, 2)
|
const visibleImages = restaurant.content.images.slice(0, 2)
|
||||||
|
|
||||||
const restaurantPageHref = restaurantPage
|
const restaurantPageHref = restaurantPage
|
||||||
? appendSlugToPathname(restaurant.nameInUrl)
|
? await appendSlugToPathname(restaurant.nameInUrl)
|
||||||
: null
|
: null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default async function RoomSidePeek({
|
|||||||
hotelId,
|
hotelId,
|
||||||
room,
|
room,
|
||||||
}: RoomSidePeekProps) {
|
}: RoomSidePeekProps) {
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const { roomSize, totalOccupancy, descriptions, images } = room
|
const { roomSize, totalOccupancy, descriptions, images } = room
|
||||||
const roomDescription = descriptions.medium
|
const roomDescription = descriptions.medium
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ export default async function WellnessAndExerciseSidePeek({
|
|||||||
spaPage,
|
spaPage,
|
||||||
}: WellnessAndExerciseSidePeekProps) {
|
}: WellnessAndExerciseSidePeekProps) {
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const wellnessExercisePageHref = appendSlugToPathname(wellnessExercisePageUrl)
|
const wellnessExercisePageHref = await appendSlugToPathname(
|
||||||
|
wellnessExercisePageUrl
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidePeek
|
<SidePeek
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import type { MaterialIconSetIconProps } from "@scandic-hotels/design-system/Ico
|
|||||||
|
|
||||||
import { FacilityEnum } from "@/types/enums/facilities"
|
import { FacilityEnum } from "@/types/enums/facilities"
|
||||||
|
|
||||||
|
import type { JSX } from "react";
|
||||||
|
|
||||||
const facilityToIconMap: Record<FacilityEnum, IconName> = {
|
const facilityToIconMap: Record<FacilityEnum, IconName> = {
|
||||||
[FacilityEnum.AccessibleBathingControls]: IconName.StarFilled,
|
[FacilityEnum.AccessibleBathingControls]: IconName.StarFilled,
|
||||||
[FacilityEnum.AccessibleBathtubs]: IconName.StarFilled,
|
[FacilityEnum.AccessibleBathtubs]: IconName.StarFilled,
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ import type { HotelPageProps } from "@/types/components/hotelPage/hotelPage"
|
|||||||
import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation"
|
import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation"
|
||||||
|
|
||||||
export default async function HotelPage({ hotelId }: HotelPageProps) {
|
export default async function HotelPage({ hotelId }: HotelPageProps) {
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
|
|
||||||
void getHotelPage()
|
void getHotelPage()
|
||||||
void getHotel({
|
void getHotel({
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default async function MeetingsSubpage({
|
|||||||
additionalData,
|
additionalData,
|
||||||
}: MeetingsSubpageProps) {
|
}: MeetingsSubpageProps) {
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const heading = intl.formatMessage({
|
const heading = intl.formatMessage({
|
||||||
defaultMessage: "Meetings, Conferences & Events",
|
defaultMessage: "Meetings, Conferences & Events",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export default async function HotelSubpage({
|
|||||||
hotelId,
|
hotelId,
|
||||||
subpage,
|
subpage,
|
||||||
}: HotelSubpageProps) {
|
}: HotelSubpageProps) {
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const [hotelPageData, hotelData] = await Promise.all([
|
const [hotelPageData, hotelData] = await Promise.all([
|
||||||
getHotelPage(),
|
getHotelPage(),
|
||||||
getHotel({ hotelId, language: lang, isCardOnlyPayment: false }),
|
getHotel({ hotelId, language: lang, isCardOnlyPayment: false }),
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ import TrackingSDK from "@/components/TrackingSDK"
|
|||||||
import styles from "./loyaltyPage.module.css"
|
import styles from "./loyaltyPage.module.css"
|
||||||
|
|
||||||
export default async function LoyaltyPage() {
|
export default async function LoyaltyPage() {
|
||||||
const loyaltyPageRes = await serverClient().contentstack.loyaltyPage.get()
|
const caller = await serverClient()
|
||||||
|
const loyaltyPageRes = await caller.contentstack.loyaltyPage.get()
|
||||||
|
|
||||||
if (!loyaltyPageRes) {
|
if (!loyaltyPageRes) {
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import { serverClient } from "@/lib/trpc/server"
|
|||||||
import StaticPage from ".."
|
import StaticPage from ".."
|
||||||
|
|
||||||
export default async function CollectionPage() {
|
export default async function CollectionPage() {
|
||||||
const collectionPageRes =
|
const caller = await serverClient()
|
||||||
await serverClient().contentstack.collectionPage.get()
|
const collectionPageRes = await caller.contentstack.collectionPage.get()
|
||||||
|
|
||||||
if (!collectionPageRes) {
|
if (!collectionPageRes) {
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/Bread
|
|||||||
import StaticPage from ".."
|
import StaticPage from ".."
|
||||||
|
|
||||||
export default async function ContentPage() {
|
export default async function ContentPage() {
|
||||||
const contentPageRes = await serverClient().contentstack.contentPage.get()
|
const caller = await serverClient()
|
||||||
|
const contentPageRes = await caller.contentstack.contentPage.get()
|
||||||
|
|
||||||
if (!contentPageRes) {
|
if (!contentPageRes) {
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ import Navigation from "./Navigation"
|
|||||||
import styles from "./footer.module.css"
|
import styles from "./footer.module.css"
|
||||||
|
|
||||||
export default async function Footer() {
|
export default async function Footer() {
|
||||||
const footerData = await getCurrentFooter(getLang())
|
const lang = await getLang()
|
||||||
|
const footerData = await getCurrentFooter(lang)
|
||||||
if (!footerData) {
|
if (!footerData) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ export default async function TopMenu({
|
|||||||
}: TopMenuProps) {
|
}: TopMenuProps) {
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const user = await getName()
|
const user = await getName()
|
||||||
|
const lang = await getLang()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.topMenu}>
|
<div className={styles.topMenu}>
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
@@ -48,7 +50,7 @@ export default async function TopMenu({
|
|||||||
<>
|
<>
|
||||||
{user ? (
|
{user ? (
|
||||||
<Link
|
<Link
|
||||||
href={overview[getLang()]}
|
href={overview[lang]}
|
||||||
className={styles.sessionLink}
|
className={styles.sessionLink}
|
||||||
prefetch={false}
|
prefetch={false}
|
||||||
>
|
>
|
||||||
@@ -57,7 +59,7 @@ export default async function TopMenu({
|
|||||||
) : null}
|
) : null}
|
||||||
<div className={styles.loginSeparator} />
|
<div className={styles.loginSeparator} />
|
||||||
<Link
|
<Link
|
||||||
href={logout[getLang()]}
|
href={logout[lang]}
|
||||||
className={styles.sessionLink}
|
className={styles.sessionLink}
|
||||||
prefetch={false}
|
prefetch={false}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ import TopMenu from "./TopMenu"
|
|||||||
import styles from "./header.module.css"
|
import styles from "./header.module.css"
|
||||||
|
|
||||||
export default async function Header() {
|
export default async function Header() {
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const [data, user] = await Promise.all([getCurrentHeader(lang), getName()])
|
const [data, user] = await Promise.all([getCurrentHeader(lang), getName()])
|
||||||
|
|
||||||
if (!data?.header) {
|
if (!data?.header) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const homeHref = homeHrefs[env.NODE_ENV][getLang()]
|
const homeHref = homeHrefs[env.NODE_ENV][lang]
|
||||||
const { frontpageLinkText, logo, menu, topMenu } = data.header
|
const { frontpageLinkText, logo, menu, topMenu } = data.header
|
||||||
|
|
||||||
const topMenuMobileLinks = topMenu.links
|
const topMenuMobileLinks = topMenu.links
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import { Lang, localeToLang } from "@/constants/languages"
|
|||||||
|
|
||||||
import { getLang } from "@/i18n/serverContext"
|
import { getLang } from "@/i18n/serverContext"
|
||||||
|
|
||||||
export default function LangPopup() {
|
export default async function LangPopup() {
|
||||||
const headersList = headers()
|
const headersList = await headers()
|
||||||
const preferedLang = headersList.get("Accept-Language") ?? ""
|
const preferedLang = headersList.get("Accept-Language") ?? ""
|
||||||
|
|
||||||
const possibleLangs = Object.keys(localeToLang)
|
const possibleLangs = Object.keys(localeToLang)
|
||||||
@@ -18,7 +18,8 @@ export default function LangPopup() {
|
|||||||
|
|
||||||
const langOfChoice: Lang = localeToLang[preferedLang as Lang]
|
const langOfChoice: Lang = localeToLang[preferedLang as Lang]
|
||||||
|
|
||||||
if (langOfChoice === getLang()) {
|
const lang = await getLang()
|
||||||
|
if (langOfChoice === lang) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import { texts } from "./Texts"
|
|||||||
|
|
||||||
import styles from "./notFound.module.css"
|
import styles from "./notFound.module.css"
|
||||||
|
|
||||||
export default function NotFound() {
|
export default async function NotFound() {
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const infoTexts = texts[lang]
|
const infoTexts = texts[lang]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { cloneElement } from "react"
|
||||||
|
|
||||||
import { renderOptions } from "./renderOptions"
|
import { renderOptions } from "./renderOptions"
|
||||||
|
|
||||||
import type { EmbedByUid } from "@/types/components/deprecatedjsontohtml"
|
import type { EmbedByUid } from "@/types/components/deprecatedjsontohtml"
|
||||||
@@ -40,10 +42,10 @@ export function nodeChildrenToHtml(
|
|||||||
if (!element) {
|
if (!element) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
return {
|
|
||||||
...element,
|
return cloneElement(element, {
|
||||||
key: `child-rte-${i}`,
|
key: `child-rte-${i}`,
|
||||||
}
|
})
|
||||||
})
|
})
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import styles from "./authCard.module.css"
|
|||||||
export default async function EmployeeBenefitsAuthCard() {
|
export default async function EmployeeBenefitsAuthCard() {
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
|
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
|
|
||||||
const isLoggedIn = await isLoggedInUser()
|
const isLoggedIn = await isLoggedInUser()
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import styles from "./callToActions.module.css"
|
|||||||
export default async function EmployeeBenefitsCallToActions() {
|
export default async function EmployeeBenefitsCallToActions() {
|
||||||
const session = await auth()
|
const session = await auth()
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
|
|
||||||
if (!isValidSession(session)) {
|
if (!isValidSession(session)) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import SocialLink from "./SocialLink"
|
|||||||
import styles from "./details.module.css"
|
import styles from "./details.module.css"
|
||||||
|
|
||||||
export default async function FooterDetails() {
|
export default async function FooterDetails() {
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
// preloaded
|
// preloaded
|
||||||
const footer = await getFooter()
|
const footer = await getFooter()
|
||||||
@@ -72,7 +72,7 @@ export default async function FooterDetails() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function FooterDetailsSkeleton() {
|
export async function FooterDetailsSkeleton() {
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const currentYear = new Date().getFullYear()
|
const currentYear = new Date().getFullYear()
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ export function preload() {
|
|||||||
void getFooter()
|
void getFooter()
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Footer() {
|
export default async function Footer() {
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
if (!env.isLangLive(lang)) {
|
if (!env.isLangLive(lang)) {
|
||||||
return <CurrentFooter />
|
return <CurrentFooter />
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default async function TopMenu() {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com"
|
const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com"
|
||||||
const findMyBookingUrl = !env.isLangLive(lang)
|
const findMyBookingUrl = !env.isLangLive(lang)
|
||||||
? getCurrentWebUrl({
|
? getCurrentWebUrl({
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import TopMenu, { TopMenuSkeleton } from "./TopMenu"
|
|||||||
|
|
||||||
import styles from "./header.module.css"
|
import styles from "./header.module.css"
|
||||||
|
|
||||||
export default function Header() {
|
export default async function Header() {
|
||||||
void getName()
|
void getName()
|
||||||
|
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
if (!env.isLangLive(lang)) {
|
if (!env.isLangLive(lang)) {
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<HeaderFallback />}>
|
<Suspense fallback={<HeaderFallback />}>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectR
|
|||||||
|
|
||||||
export default async function Footer({ booking, room }: FooterProps) {
|
export default async function Footer({ booking, room }: FooterProps) {
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const lang = getLang()
|
const lang = await getLang()
|
||||||
|
|
||||||
const petRoomPackage = booking.packages.find(
|
const petRoomPackage = booking.packages.find(
|
||||||
(p) => p.code === RoomPackageCodeEnum.PET_ROOM
|
(p) => p.code === RoomPackageCodeEnum.PET_ROOM
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ export async function Receipt({ refId }: { refId: string }) {
|
|||||||
|
|
||||||
const isLoggedIn = await isLoggedInUser()
|
const isLoggedIn = await isLoggedInUser()
|
||||||
|
|
||||||
const bv = cookies().get("bv")?.value
|
const cookieStore = await cookies()
|
||||||
|
const bv = cookieStore.get("bv")?.value
|
||||||
let bookingConfirmation
|
let bookingConfirmation
|
||||||
if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
bookingConfirmation = await getBookingConfirmation(refId)
|
bookingConfirmation = await getBookingConfirmation(refId)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user