diff --git a/app/[lang]/(live)/(protected)/my-pages/@breadcrumbs/[...path]/page.tsx b/app/[lang]/(live)/(protected)/my-pages/@breadcrumbs/[...path]/page.tsx index fd46c04a6..564ca0b78 100644 --- a/app/[lang]/(live)/(protected)/my-pages/@breadcrumbs/[...path]/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/@breadcrumbs/[...path]/page.tsx @@ -2,14 +2,11 @@ import { Suspense } from "react" import Breadcrumbs from "@/components/Breadcrumbs" import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton" -import { setLang } from "@/i18n/serverContext" import type { LangParams, PageArgs } from "@/types/params" import { PageContentTypeEnum } from "@/types/requests/contentType" -export default function AllBreadcrumbs({ params }: PageArgs) { - setLang(params.lang) - +export default function AllBreadcrumbs({}: PageArgs) { return ( }> diff --git a/app/[lang]/(live)/(protected)/my-pages/[...path]/page.tsx b/app/[lang]/(live)/(protected)/my-pages/[...path]/page.tsx index 3170c0dfd..cd058ea45 100644 --- a/app/[lang]/(live)/(protected)/my-pages/[...path]/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/[...path]/page.tsx @@ -6,7 +6,6 @@ import Blocks from "@/components/Blocks" import SectionHeader from "@/components/Section/Header" import TrackingSDK from "@/components/TrackingSDK" import { getIntl } from "@/i18n" -import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" @@ -14,11 +13,9 @@ import type { LangParams, PageArgs } from "@/types/params" export { generateMetadata } from "@/utils/generateMetadata" -export default async function MyPages({ - params, -}: PageArgs) { - setLang(params.lang) - +export default async function MyPages({}: PageArgs< + LangParams & { path: string[] } +>) { const accountPageRes = await serverClient().contentstack.accountPage.get() const intl = await getIntl() diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/@communication/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/@communication/page.tsx index 767c27815..158c4c0cd 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/@communication/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/@communication/page.tsx @@ -2,17 +2,12 @@ import ManagePreferencesButton from "@/components/Profile/ManagePreferencesButto import Body from "@/components/TempDesignSystem/Text/Body" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { getIntl } from "@/i18n" -import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" import type { LangParams, PageArgs } from "@/types/params" -export default async function CommunicationSlot({ - params, -}: PageArgs) { - setLang(params.lang) - +export default async function CommunicationSlot({}: PageArgs) { const intl = await getIntl() return (
diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/@creditCards/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/@creditCards/page.tsx index 84ade3e0e..7e8cb5f86 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/@creditCards/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/@creditCards/page.tsx @@ -5,14 +5,12 @@ import CreditCardList from "@/components/Profile/CreditCardList" import Body from "@/components/TempDesignSystem/Text/Body" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { getIntl } from "@/i18n" -import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" import type { LangParams, PageArgs } from "@/types/params" -export default async function CreditCardSlot({ params }: PageArgs) { - setLang(params.lang) +export default async function CreditCardSlot({}: PageArgs) { const intl = await getIntl() const creditCards = await serverClient().user.creditCards() diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/@membershipCards/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/@membershipCards/page.tsx index 7674a40fb..4563cff0f 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/@membershipCards/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/@membershipCards/page.tsx @@ -5,16 +5,12 @@ import Link from "@/components/TempDesignSystem/Link" import Body from "@/components/TempDesignSystem/Text/Body" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { getIntl } from "@/i18n" -import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" import type { LangParams, PageArgs } from "@/types/params" -export default async function MembershipCardSlot({ - params, -}: PageArgs) { - setLang(params.lang) +export default async function MembershipCardSlot({}: PageArgs) { const intl = await getIntl() const membershipCards = await getMembershipCards() diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/@profile/edit/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/@profile/edit/page.tsx index 2e2386b9d..80dc3c4de 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/@profile/edit/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/@profile/edit/page.tsx @@ -1,15 +1,10 @@ import { getProfile } from "@/lib/trpc/memoizedRequests" import Form from "@/components/Forms/Edit/Profile" -import { setLang } from "@/i18n/serverContext" import type { LangParams, PageArgs } from "@/types/params" -export default async function EditProfileSlot({ - params, -}: PageArgs) { - setLang(params.lang) - +export default async function EditProfileSlot({}: PageArgs) { const user = await getProfile() if (!user || "error" in user) { return null diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/@profile/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/@profile/page.tsx index cd97725a3..84a8aba22 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/@profile/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/@profile/page.tsx @@ -16,14 +16,12 @@ import Link from "@/components/TempDesignSystem/Link" import Body from "@/components/TempDesignSystem/Text/Body" import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" -import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" import type { LangParams, PageArgs } from "@/types/params" export default async function Profile({ params }: PageArgs) { - setLang(params.lang) const intl = await getIntl() const user = await getProfile() if (!user || "error" in user) { diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/page.tsx index 33c1ceb0c..fb7a9fd2d 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/page.tsx @@ -3,14 +3,12 @@ import "./profileLayout.css" import { serverClient } from "@/lib/trpc/server" import TrackingSDK from "@/components/TrackingSDK" -import { setLang } from "@/i18n/serverContext" import type { LangParams, PageArgs } from "@/types/params" export { generateMetadata } from "@/utils/generateMetadata" -export default async function ProfilePage({ params }: PageArgs) { - setLang(params.lang) +export default async function ProfilePage({}: PageArgs) { const accountPage = await serverClient().contentstack.accountPage.get() if (!accountPage) { diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx index 939af980e..151efabc2 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx @@ -2,7 +2,6 @@ import { Suspense } from "react" import Breadcrumbs from "@/components/Breadcrumbs" import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton" -import { setLang } from "@/i18n/serverContext" import type { ContentTypeParams, LangParams, PageArgs } from "@/types/params" import { PageContentTypeEnum } from "@/types/requests/contentType" @@ -16,8 +15,6 @@ const IGNORED_CONTENT_TYPES = [ export default function PageBreadcrumbs({ params, }: PageArgs) { - setLang(params.lang) - if (IGNORED_CONTENT_TYPES.includes(params.contentType)) { return null } diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx index c803b8159..342dc6031 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx @@ -16,7 +16,7 @@ import LoyaltyPage from "@/components/ContentType/LoyaltyPage" import StartPage from "@/components/ContentType/StartPage" import CollectionPage from "@/components/ContentType/StaticPages/CollectionPage" import ContentPage from "@/components/ContentType/StaticPages/ContentPage" -import { getLang, setLang } from "@/i18n/serverContext" +import { getLang } from "@/i18n/serverContext" import { isValidSession } from "@/utils/session" import type { @@ -33,8 +33,6 @@ export default async function ContentTypePage({ params, searchParams, }: PageArgs) { - setLang(params.lang) - const pathname = headers().get("x-pathname") || "" switch (params.contentType) { diff --git a/app/[lang]/(live)/(public)/hotelreservation/(confirmation)/booking-confirmation/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(confirmation)/booking-confirmation/page.tsx index ba645e64c..2e9ab9faa 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(confirmation)/booking-confirmation/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(confirmation)/booking-confirmation/page.tsx @@ -1,15 +1,12 @@ import { getBookingConfirmation } from "@/lib/trpc/memoizedRequests" import BookingConfirmation from "@/components/HotelReservation/BookingConfirmation" -import { setLang } from "@/i18n/serverContext" import type { LangParams, PageArgs } from "@/types/params" export default async function BookingConfirmationPage({ - params, searchParams, }: PageArgs) { - setLang(params.lang) void getBookingConfirmation(searchParams.confirmationNumber) return ( diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/map/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/map/page.tsx index dcd0034f5..0c0b61f56 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/map/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/map/page.tsx @@ -3,7 +3,6 @@ import { Suspense } from "react" import { SelectHotelMapContainer } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer" import { SelectHotelMapContainerSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainerSkeleton" import { MapContainer } from "@/components/MapContainer" -import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" @@ -11,11 +10,8 @@ import type { AlternativeHotelsSearchParams } from "@/types/components/hotelRese import type { LangParams, PageArgs } from "@/types/params" export default async function SelectHotelMapPage({ - params, searchParams, }: PageArgs) { - setLang(params.lang) - return (
diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/page.tsx index f7461912b..ecc8dd0f6 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/page.tsx @@ -2,7 +2,6 @@ import { Suspense } from "react" import SelectHotel from "@/components/HotelReservation/SelectHotel" import { SelectHotelSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelSkeleton" -import { setLang } from "@/i18n/serverContext" import type { AlternativeHotelsSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams" import type { LangParams, PageArgs } from "@/types/params" @@ -11,8 +10,6 @@ export default async function AlternativeHotelsPage({ params, searchParams, }: PageArgs) { - setLang(params.lang) - const roomKey = Object.keys(searchParams) .filter((key) => key.startsWith("room[")) .map((key) => searchParams[key]) diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/details/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/details/page.tsx index 5aed6b8b3..1fd366a7a 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/details/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/details/page.tsx @@ -21,7 +21,6 @@ import MobileSummary from "@/components/HotelReservation/EnterDetails/Summary/Mo import { generateChildrenString } from "@/components/HotelReservation/utils" import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" -import { setLang } from "@/i18n/serverContext" import EnterDetailsProvider from "@/providers/EnterDetailsProvider" import { convertSearchParamsToObj } from "@/utils/url" @@ -49,8 +48,6 @@ export default async function DetailsPage({ params: { lang }, searchParams, }: PageArgs) { - setLang(lang) - const intl = await getIntl() const selectRoomParams = new URLSearchParams(searchParams) const booking = convertSearchParamsToObj(searchParams) diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/page.tsx index 1dcd09073..07c704607 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/page.tsx @@ -3,7 +3,6 @@ import { Suspense } from "react" import { env } from "@/env/server" import TrackingSDK from "@/components/TrackingSDK" -import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" @@ -14,8 +13,6 @@ import { import type { LangParams, PageArgs } from "@/types/params" export default function HotelReservationPage({ params }: PageArgs) { - setLang(params.lang) - if (!env.ENABLE_BOOKING_WIDGET_HOTELRESERVATION_PATH) { return null } diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/map/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/map/page.tsx index 194814e42..536438828 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/map/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/map/page.tsx @@ -4,7 +4,6 @@ import { Suspense } from "react" import { SelectHotelMapContainer } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer" import { SelectHotelMapContainerSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainerSkeleton" import { MapContainer } from "@/components/MapContainer" -import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" @@ -12,11 +11,8 @@ import type { SelectHotelSearchParams } from "@/types/components/hotelReservatio import type { LangParams, PageArgs } from "@/types/params" export default async function SelectHotelMapPage({ - params, searchParams, }: PageArgs) { - setLang(params.lang) - const suspenseKey = stringify(searchParams) return ( diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx index 0d611b429..0ebfc686f 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx @@ -3,7 +3,6 @@ import { Suspense } from "react" import SelectHotel from "@/components/HotelReservation/SelectHotel" import { SelectHotelSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelSkeleton" -import { setLang } from "@/i18n/serverContext" import type { SelectHotelSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams" import type { LangParams, PageArgs } from "@/types/params" @@ -12,8 +11,6 @@ export default async function SelectHotelPage({ params, searchParams, }: PageArgs) { - setLang(params.lang) - const suspenseKey = stringify(searchParams) return ( diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx index 15be827ea..ba913c53b 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx @@ -4,7 +4,6 @@ import { Suspense } from "react" import SelectRate from "@/components/HotelReservation/SelectRate" import { HotelInfoCardSkeleton } from "@/components/HotelReservation/SelectRate/HotelInfoCard" import { RoomsContainerSkeleton } from "@/components/HotelReservation/SelectRate/RoomsContainer/RoomsContainerSkeleton" -import { setLang } from "@/i18n/serverContext" import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate" import type { LangParams, PageArgs } from "@/types/params" @@ -13,8 +12,6 @@ export default async function SelectRatePage({ params, searchParams, }: PageArgs) { - setLang(params.lang) - const suspenseKey = stringify(searchParams) return ( diff --git a/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/page.tsx index f4baef247..509aae1de 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/page.tsx @@ -2,15 +2,12 @@ import { Suspense } from "react" import { MyStay } from "@/components/HotelReservation/MyStay" import { MyStaySkeleton } from "@/components/HotelReservation/MyStay/myStaySkeleton" -import { setLang } from "@/i18n/serverContext" import type { LangParams, PageArgs } from "@/types/params" export default async function MyStayPage({ params, }: PageArgs) { - setLang(params.lang) - return ( }> diff --git a/app/[lang]/(live)/@footer/error.tsx b/app/[lang]/(live)/@footer/error.tsx new file mode 100644 index 000000000..74d55466e --- /dev/null +++ b/app/[lang]/(live)/@footer/error.tsx @@ -0,0 +1,22 @@ +"use client" + +import { env } from "@/env/client" + +export default function Error({ + error, +}: { + error: Error & { digest?: string } + reset: () => void +}) { + return ( +
+
Unable to render footer
+ {env.NEXT_PUBLIC_NODE_ENV === "development" && ( +
+
{error.message}
+
{error.stack}
+
+ )} +
+ ) +} diff --git a/app/[lang]/(live)/@footer/page.tsx b/app/[lang]/(live)/@footer/page.tsx new file mode 100644 index 000000000..6bbb494b5 --- /dev/null +++ b/app/[lang]/(live)/@footer/page.tsx @@ -0,0 +1,16 @@ +import { env } from "@/env/server" + +import CurrentFooter from "@/components/Current/Footer" +import Footer, { preload } from "@/components/Footer" + +import type { LangParams, PageArgs } from "@/types/params" + +export default function FooterSlot({}: PageArgs) { + if (env.HIDE_FOR_NEXT_RELEASE) { + return + } + + preload() + + return