Merged in feat/SW-2782-create-sas-branded-header (pull request #2878)
feat(SW-2782): Updated header as per design, added language switcher and user menu * feat(SW-2782): Updated header as per design, added language switcher and user menu * feat(SW-2782): Updated UI as per design * feat(SW-2782): Optimised code with use of Popover and modal from RAC Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -5,7 +5,7 @@ import { getNonContentstackUrls } from "../metadata/output"
|
||||
import { getLanguageSwitcherInput } from "./input"
|
||||
import { getUrlsOfAllLanguages } from "./utils"
|
||||
|
||||
import type { LanguageSwitcherData } from "../../../types/languageSwitcher"
|
||||
import type { LanguageSwitcherData } from "@scandic-hotels/common/constants/language"
|
||||
|
||||
export const languageSwitcherQueryRouter = router({
|
||||
get: publicProcedure
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import {
|
||||
Lang,
|
||||
type LanguageSwitcherData,
|
||||
} from "@scandic-hotels/common/constants/language"
|
||||
import { createLogger } from "@scandic-hotels/common/logger/createLogger"
|
||||
import { createCounter } from "@scandic-hotels/common/telemetry"
|
||||
import { removeTrailingSlash } from "@scandic-hotels/common/utils/url"
|
||||
@@ -57,10 +60,7 @@ import {
|
||||
import { generateTag } from "../../../utils/generateTag"
|
||||
import { validateLanguageSwitcherData } from "./output"
|
||||
|
||||
import type {
|
||||
LanguageSwitcherData,
|
||||
LanguageSwitcherQueryDataRaw,
|
||||
} from "../../../types/languageSwitcher"
|
||||
import type { LanguageSwitcherQueryDataRaw } from "../../../types/languageSwitcher"
|
||||
|
||||
export const languageSwitcherAffix = "languageSwitcher"
|
||||
|
||||
|
||||
@@ -12,11 +12,12 @@ import { RTETypeEnum } from "../../../types/RTEenums"
|
||||
import { destinationFilterSchema } from "../schemas/destinationFilters"
|
||||
import { systemSchema } from "../schemas/system"
|
||||
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import type {
|
||||
Lang,
|
||||
LanguageSwitcherData,
|
||||
} from "@scandic-hotels/common/constants/language"
|
||||
import type { ImageVaultAsset } from "@scandic-hotels/common/utils/imageVault"
|
||||
|
||||
import type { LanguageSwitcherData } from "../../../types/languageSwitcher"
|
||||
|
||||
const metaDataJsonSchema = z.object({
|
||||
children: z.array(
|
||||
z.object({
|
||||
|
||||
@@ -26,9 +26,9 @@ import { getMetadataInput } from "./input"
|
||||
import { getNonContentstackUrls, rawMetadataSchema } from "./output"
|
||||
import { affix, getCityData, getCountryData } from "./utils"
|
||||
|
||||
import type { LanguageSwitcherData } from "@scandic-hotels/common/constants/language"
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
|
||||
import type { LanguageSwitcherData } from "../../../types/languageSwitcher"
|
||||
import type { RawMetadataSchema } from "./output"
|
||||
|
||||
const fetchMetadata = cache(async function fetchMemoizedMetadata<T>(
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
type CurrentLanguageResult = {
|
||||
url: string
|
||||
isExternal?: boolean
|
||||
}
|
||||
|
||||
export type LanguageSwitcherData = {
|
||||
da?: CurrentLanguageResult
|
||||
de?: CurrentLanguageResult
|
||||
en?: CurrentLanguageResult
|
||||
fi?: CurrentLanguageResult
|
||||
no?: CurrentLanguageResult
|
||||
sv?: CurrentLanguageResult
|
||||
}
|
||||
|
||||
type LanguageResult = {
|
||||
web?: {
|
||||
original_url?: string | null
|
||||
|
||||
Reference in New Issue
Block a user