Merged in feature/SW-2320-languagebased-hide-for-next-release (pull request #1937)

Language based alternative to HIDE_FOR_NEXT_RELEASE

Approved-by: Anton Gunnarsson
This commit is contained in:
Joakim Jäderberg
2025-05-05 10:53:28 +00:00
parent 3bcf6cff4a
commit 5784822a1e
41 changed files with 232 additions and 133 deletions

View File

@@ -1,7 +1,7 @@
import { env } from "@/env/server"
import { getDestinationCityPage } from "@/lib/trpc/memoizedRequests"
import BookingWidget from "@/components/BookingWidget"
import { BookingWidget } from "@/components/BookingWidget"
import type { BookingWidgetSearchData } from "@/types/components/bookingWidget"
import type { PageArgs } from "@/types/params"
@@ -9,9 +9,10 @@ import type { PageArgs } from "@/types/params"
export default async function BookingWidgetDestinationCityPage({
searchParams,
}: PageArgs<{}, BookingWidgetSearchData>) {
if (!env.ENABLE_BOOKING_WIDGET) {
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
return null
}
const { bookingCode } = searchParams
const pageData = await getDestinationCityPage()

View File

@@ -1,7 +1,7 @@
import { env } from "@/env/server"
import { getHotel, getHotelPage } from "@/lib/trpc/memoizedRequests"
import BookingWidget from "@/components/BookingWidget"
import { BookingWidget } from "@/components/BookingWidget"
import { getLang } from "@/i18n/serverContext"
import type { BookingWidgetSearchData } from "@/types/components/bookingWidget"
@@ -10,9 +10,10 @@ import type { PageArgs } from "@/types/params"
export default async function BookingWidgetHotelPage({
searchParams,
}: PageArgs<{}, BookingWidgetSearchData & { subpage?: string }>) {
if (!env.ENABLE_BOOKING_WIDGET) {
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
return null
}
const { bookingCode, subpage } = searchParams
const hotelPageData = await getHotelPage()

View File

@@ -1,11 +0,0 @@
import { env } from "@/env/server"
import { BookingWidgetSkeleton } from "@/components/BookingWidget/Client"
export default function LoadingBookingWidget() {
if (!env.ENABLE_BOOKING_WIDGET_HOTELRESERVATION_PATH) {
return null
}
return <BookingWidgetSkeleton />
}

View File

@@ -1,6 +1,6 @@
import { env } from "@/env/server"
import BookingWidget from "@/components/BookingWidget"
import { BookingWidget } from "@/components/BookingWidget"
import type { BookingWidgetSearchData } from "@/types/components/bookingWidget"
import type { LangParams, PageArgs } from "@/types/params"
@@ -8,7 +8,7 @@ import type { LangParams, PageArgs } from "@/types/params"
export default async function BookingWidgetPage({
searchParams,
}: PageArgs<LangParams, BookingWidgetSearchData>) {
if (!env.ENABLE_BOOKING_WIDGET_HOTELRESERVATION_PATH) {
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
return null
}

View File

@@ -1,11 +0,0 @@
import { env } from "@/env/server"
import { BookingWidgetSkeleton } from "@/components/BookingWidget/Client"
export default function LoadingBookingWidget() {
if (!env.ENABLE_BOOKING_WIDGET) {
return null
}
return <BookingWidgetSkeleton />
}

View File

@@ -1,14 +1,15 @@
import { env } from "@/env/server"
import BookingWidget from "@/components/BookingWidget"
import { BookingWidget } from "@/components/BookingWidget"
import type { BookingWidgetSearchData } from "@/types/components/bookingWidget"
import type { PageArgs } from "@/types/params"
import type { LangParams, PageArgs } from "@/types/params"
export default async function BookingWidgetPage({
searchParams,
}: PageArgs<{}, BookingWidgetSearchData>) {
if (!env.ENABLE_BOOKING_WIDGET) {
params,
}: PageArgs<LangParams, BookingWidgetSearchData>) {
if (!env.isLangLive(params.lang)) {
return null
}