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

@@ -16,6 +16,7 @@ import useDropdownStore from "@/stores/main-menu"
import { IconName } from "@/components/Icons/iconName"
import LanguageSwitcher from "@/components/LanguageSwitcher"
import { useHandleKeyUp } from "@/hooks/useHandleKeyUp"
import { useIsLangLive } from "@/hooks/useIsLangLive"
import useLang from "@/hooks/useLang"
import { getCurrentWebUrl } from "@/utils/url"
@@ -32,6 +33,7 @@ export default function MobileMenu({
topLink,
isLoggedIn,
}: React.PropsWithChildren<MobileMenuProps>) {
const isLangLive = useIsLangLive()
const lang = useLang()
const intl = useIntl()
const {
@@ -76,7 +78,7 @@ export default function MobileMenu({
})
const baseUrl = env.NEXT_PUBLIC_PUBLIC_URL || "https://www.scandichotels.com"
const findMyBookingUrl = env.NEXT_PUBLIC_HIDE_FOR_NEXT_RELEASE
const findMyBookingUrl = !isLangLive
? getCurrentWebUrl({
path: findMyBookingCurrentWebPath[lang],
lang,

View File

@@ -34,7 +34,7 @@ export default async function TopMenu() {
const lang = getLang()
const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com"
const findMyBookingUrl = env.HIDE_FOR_NEXT_RELEASE
const findMyBookingUrl = !env.isLangLive(lang)
? getCurrentWebUrl({
path: findMyBookingCurrentWebPath[lang],
lang,

View File

@@ -4,6 +4,7 @@ import { env } from "@/env/server"
import { getHeader, getName } from "@/lib/trpc/memoizedRequests"
import CurrentHeader from "@/components/Current/Header"
import { getLang } from "@/i18n/serverContext"
import HeaderFallback from "../Current/Header/HeaderFallback"
import MainMenu from "./MainMenu"
@@ -14,7 +15,8 @@ import styles from "./header.module.css"
export default function Header() {
void getName()
if (env.HIDE_FOR_NEXT_RELEASE) {
const lang = getLang()
if (!env.isLangLive(lang)) {
return (
<Suspense fallback={<HeaderFallback />}>
<CurrentHeader />