Merged in feat/sw-2863-move-contentstack-router-to-trpc-package (pull request #2389)
feat(SW-2863): Move contentstack router to trpc package * Add exports to packages and lint rule to prevent relative imports * Add env to trpc package * Add eslint to trpc package * Apply lint rules * Use direct imports from trpc package * Add lint-staged config to trpc * Move lang enum to common * Restructure trpc package folder structure * WIP first step * update internal imports in trpc * Fix most errors in scandic-web Just 100 left... * Move Props type out of trpc * Fix CategorizedFilters types * Move more schemas in hotel router * Fix deps * fix getNonContentstackUrls * Fix import error * Fix entry error handling * Fix generateMetadata metrics * Fix alertType enum * Fix duplicated types * lint:fix * Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package * Fix broken imports * Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package Approved-by: Linus Flood
This commit is contained in:
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"typescript.tsdk": "node_modules/typescript/lib"
|
"typescript.tsdk": "node_modules/typescript/lib"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ DEBUG_QUERIES="false"
|
|||||||
SEAMLESS_ENVIRONMENT_SUBDOMAIN="www"
|
SEAMLESS_ENVIRONMENT_SUBDOMAIN="www"
|
||||||
|
|
||||||
SEAMLESS_LOGIN="https://${SEAMLESS_ENVIRONMENT_SUBDOMAIN}.scandichotels.{topleveldomain}/updatelogin"
|
SEAMLESS_LOGIN="https://${SEAMLESS_ENVIRONMENT_SUBDOMAIN}.scandichotels.{topleveldomain}/updatelogin"
|
||||||
SEAMLESS_LOGOUT="https://${SEAMLESS_ENVIRONMENT_SUBDOMAIN}.scandichotels.{topleveldomain}/updatelogout?newweb=1"
|
SEAMLESS_LOGOUT="https://${SEAMLESS_ENVIRONMENT_SUBDOMAIN}.scandichotels.{topleveldomain}/updatelogout?newweb=1"
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
// RoomRate,
|
// RoomRate,
|
||||||
// SignedInDetailsSchema,
|
// SignedInDetailsSchema,
|
||||||
// } from "@/types/components/hotelReservation/enterDetails/details"
|
// } from "@/types/components/hotelReservation/enterDetails/details"
|
||||||
// import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
|
// import { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter"
|
||||||
// import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate"
|
// import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||||
// import { CurrencyEnum } from "@/types/enums/currency"
|
// import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||||
// import { PackageTypeEnum } from "@/types/enums/packages"
|
// import { PackageTypeEnum } from "@scandic-hotels/trpc/enums/packages"
|
||||||
|
|
||||||
// export const booking: SelectRateSearchParams = {
|
// export const booking: SelectRateSearchParams = {
|
||||||
// city: "Stockholm",
|
// city: "Stockholm",
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
|
|
||||||
|
import * as api from "@scandic-hotels/trpc/api"
|
||||||
|
|
||||||
import { countriesMap } from "@/constants/countries"
|
import { countriesMap } from "@/constants/countries"
|
||||||
import { ApiLang } from "@/constants/languages"
|
import { ApiLang } from "@/constants/languages"
|
||||||
import * as api from "@/lib/api"
|
|
||||||
import { getProfile } from "@/lib/trpc/memoizedRequests"
|
import { getProfile } from "@/lib/trpc/memoizedRequests"
|
||||||
import { protectedServerActionProcedure } from "@/server/trpc"
|
import { protectedServerActionProcedure } from "@/server/trpc"
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import styles from "./page.module.css"
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/metadata/generateMetadata"
|
||||||
|
|
||||||
export default async function MyPages({}: PageArgs<
|
export default async function MyPages({}: PageArgs<
|
||||||
LangParams & { path: string[] }
|
LangParams & { path: string[] }
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import TrackingSDK from "@/components/TrackingSDK"
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/metadata/generateMetadata"
|
||||||
|
|
||||||
export default async function ProfilePage({}: PageArgs<LangParams>) {
|
export default async function ProfilePage({}: PageArgs<LangParams>) {
|
||||||
const caller = await serverClient()
|
const caller = await serverClient()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { setPreviewData } from "@/lib/previewContext"
|
import { setPreviewData } from "@scandic-hotels/trpc/previewContext"
|
||||||
|
|
||||||
import InitLivePreview from "@/components/LivePreview"
|
import InitLivePreview from "@/components/LivePreview"
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import { env } from "@/env/server"
|
|||||||
import CampaignOverviewPage from "@/components/ContentType/CampaignOverviewPage"
|
import CampaignOverviewPage from "@/components/ContentType/CampaignOverviewPage"
|
||||||
import CampaignOverviewPageSkeleton from "@/components/ContentType/CampaignOverviewPage/CampaignOverviewPageSkeleton"
|
import CampaignOverviewPageSkeleton from "@/components/ContentType/CampaignOverviewPage/CampaignOverviewPageSkeleton"
|
||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
|
||||||
|
|
||||||
export default async function CampaignOverviewPagePage() {
|
export default async function CampaignOverviewPagePage() {
|
||||||
if (!env.CAMPAIGN_PAGES_ENABLED) {
|
if (!env.CAMPAIGN_PAGES_ENABLED) {
|
||||||
notFound()
|
notFound()
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { env } from "@/env/server"
|
|||||||
import CampaignPage from "@/components/ContentType/CampaignPage"
|
import CampaignPage from "@/components/ContentType/CampaignPage"
|
||||||
import CampaignPageSkeleton from "@/components/ContentType/CampaignPage/CampaignPageSkeleton"
|
import CampaignPageSkeleton from "@/components/ContentType/CampaignPage/CampaignPageSkeleton"
|
||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/metadata/generateMetadata"
|
||||||
|
|
||||||
export default async function CampaignPagePage() {
|
export default async function CampaignPagePage() {
|
||||||
if (!env.CAMPAIGN_PAGES_ENABLED) {
|
if (!env.CAMPAIGN_PAGES_ENABLED) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import CollectionPage from "@/components/ContentType/StaticPages/CollectionPage"
|
import CollectionPage from "@/components/ContentType/StaticPages/CollectionPage"
|
||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/metadata/generateMetadata"
|
||||||
|
|
||||||
export default function CollectionPagePage() {
|
export default function CollectionPagePage() {
|
||||||
return <CollectionPage />
|
return <CollectionPage />
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import ContentPage from "@/components/ContentType/StaticPages/ContentPage"
|
|||||||
import { getLang } from "@/i18n/serverContext"
|
import { getLang } from "@/i18n/serverContext"
|
||||||
import { isLoggedInUser } from "@/utils/isLoggedInUser"
|
import { isLoggedInUser } from "@/utils/isLoggedInUser"
|
||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/metadata/generateMetadata"
|
||||||
|
|
||||||
export default async function ContentPagePage() {
|
export default async function ContentPagePage() {
|
||||||
const lang = await getLang()
|
const lang = await getLang()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import DestinationCityPageSkeleton from "@/components/ContentType/DestinationPag
|
|||||||
|
|
||||||
import type { PageArgs } from "@/types/params"
|
import type { PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/metadata/generateMetadata"
|
||||||
|
|
||||||
export default async function DestinationCityPagePage(
|
export default async function DestinationCityPagePage(
|
||||||
props: PageArgs<{}, { view?: "map"; filterFromUrl?: string }>
|
props: PageArgs<{}, { view?: "map"; filterFromUrl?: string }>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import DestinationCountryPageSkeleton from "@/components/ContentType/Destination
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/metadata/generateMetadata"
|
||||||
|
|
||||||
export default async function DestinationCountryPagePage(
|
export default async function DestinationCountryPagePage(
|
||||||
props: PageArgs<LangParams, { view?: "map"; filterFromUrl?: string }>
|
props: PageArgs<LangParams, { view?: "map"; filterFromUrl?: string }>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import DestinationOverviewPage from "@/components/ContentType/DestinationPage/De
|
|||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/metadata/generateMetadata"
|
||||||
|
|
||||||
export default function DestinationOverviewPagePage({}: PageArgs<LangParams>) {
|
export default function DestinationOverviewPagePage({}: PageArgs<LangParams>) {
|
||||||
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
|
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import HotelSubpage from "@/components/ContentType/HotelSubpage"
|
|||||||
|
|
||||||
import type { PageArgs } from "@/types/params"
|
import type { PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/metadata/generateMetadata"
|
||||||
|
|
||||||
export default async function HotelPagePage(
|
export default async function HotelPagePage(
|
||||||
props: PageArgs<{}, { subpage?: string; view?: "map" }>
|
props: PageArgs<{}, { subpage?: string; view?: "map" }>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import LoyaltyPage from "@/components/ContentType/LoyaltyPage"
|
import LoyaltyPage from "@/components/ContentType/LoyaltyPage"
|
||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/metadata/generateMetadata"
|
||||||
|
|
||||||
export default function LoyaltyPagePage() {
|
export default function LoyaltyPagePage() {
|
||||||
return <LoyaltyPage />
|
return <LoyaltyPage />
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { parseBookingWidgetSearchParams } from "@/utils/url"
|
|||||||
|
|
||||||
import type { NextSearchParams, PageArgs } from "@/types/params"
|
import type { NextSearchParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export { generateMetadata } from "@/utils/generateMetadata"
|
export { generateMetadata } from "@/utils/metadata/generateMetadata"
|
||||||
|
|
||||||
export default async function StartPagePage(
|
export default async function StartPagePage(
|
||||||
props: PageArgs<{}, NextSearchParams>
|
props: PageArgs<{}, NextSearchParams>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { notFound } from "next/navigation"
|
import { notFound } from "next/navigation"
|
||||||
|
|
||||||
|
import { myStay } from "@scandic-hotels/common/constants/routes/myStay"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BookingErrorCodeEnum,
|
BookingErrorCodeEnum,
|
||||||
PaymentCallbackStatusEnum,
|
PaymentCallbackStatusEnum,
|
||||||
} from "@/constants/booking"
|
} from "@/constants/booking"
|
||||||
import { myStay } from "@/constants/routes/myStay"
|
|
||||||
import { serverClient } from "@/lib/trpc/server"
|
import { serverClient } from "@/lib/trpc/server"
|
||||||
|
|
||||||
import GuaranteeCallback from "@/components/HotelReservation/MyStay/Ancillaries/GuaranteeCallback"
|
import GuaranteeCallback from "@/components/HotelReservation/MyStay/Ancillaries/GuaranteeCallback"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { notFound } from "next/navigation"
|
import { notFound } from "next/navigation"
|
||||||
|
|
||||||
import { GetCurrentBlockPage } from "@/lib/graphql/Query/Current/CurrentBlockPage.graphql"
|
import { GetCurrentBlockPage } from "@scandic-hotels/trpc/graphql/Query/Current/CurrentBlockPage.graphql"
|
||||||
import { GetCurrentBlockPageTrackingData } from "@/lib/graphql/Query/Current/CurrentBlockPageTrackingData.graphql"
|
import { GetCurrentBlockPageTrackingData } from "@scandic-hotels/trpc/graphql/Query/Current/CurrentBlockPageTrackingData.graphql"
|
||||||
import { request } from "@/lib/graphql/request"
|
import { request } from "@scandic-hotels/trpc/graphql/request"
|
||||||
|
|
||||||
import ContentPage from "@/components/Current/ContentPage"
|
import ContentPage from "@/components/Current/ContentPage"
|
||||||
import Tracking from "@/components/Current/Tracking"
|
import Tracking from "@/components/Current/Tracking"
|
||||||
@@ -11,9 +11,11 @@ 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(props: PageArgs<LangParams, UriParams>) {
|
export default async function CurrentContentPage(
|
||||||
const searchParams = await props.searchParams;
|
props: PageArgs<LangParams, UriParams>
|
||||||
const params = await props.params;
|
) {
|
||||||
|
const searchParams = await props.searchParams
|
||||||
|
const params = await props.params
|
||||||
try {
|
try {
|
||||||
if (!searchParams.uri) {
|
if (!searchParams.uri) {
|
||||||
throw new Error("Bad URI")
|
throw new Error("Bad URI")
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { type NextRequest, NextResponse } from "next/server"
|
import { type NextRequest, NextResponse } from "next/server"
|
||||||
|
|
||||||
|
import { languageSchema } from "@scandic-hotels/common/utils/languages"
|
||||||
|
|
||||||
import { env } from "@/env/server"
|
import { env } from "@/env/server"
|
||||||
import { serverClient } from "@/lib/trpc/server"
|
import { serverClient } from "@/lib/trpc/server"
|
||||||
|
|
||||||
import { languageSchema } from "@/utils/languages"
|
|
||||||
|
|
||||||
export const dynamic = "force-dynamic"
|
export const dynamic = "force-dynamic"
|
||||||
|
|
||||||
export async function GET(request: NextRequest) {
|
export async function GET(request: NextRequest) {
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ import { z } from "zod"
|
|||||||
|
|
||||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
import { getCacheClient } from "@scandic-hotels/common/dataCache"
|
import { getCacheClient } from "@scandic-hotels/common/dataCache"
|
||||||
|
import { generateHotelUrlTag } from "@scandic-hotels/trpc/utils/generateTag"
|
||||||
|
|
||||||
import { env } from "@/env/server"
|
import { env } from "@/env/server"
|
||||||
import { badRequest, internalServerError, notFound } from "@/server/errors/next"
|
import { badRequest, internalServerError, notFound } from "@/server/errors/next"
|
||||||
|
|
||||||
import { generateHotelUrlTag } from "@/utils/generateTag"
|
|
||||||
|
|
||||||
import type { NextRequest } from "next/server"
|
import type { NextRequest } from "next/server"
|
||||||
|
|
||||||
const validateJsonBody = z.object({
|
const validateJsonBody = z.object({
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ import { z } from "zod"
|
|||||||
|
|
||||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
import { getCacheClient } from "@scandic-hotels/common/dataCache"
|
import { getCacheClient } from "@scandic-hotels/common/dataCache"
|
||||||
|
import { generateLoyaltyConfigTag } from "@scandic-hotels/trpc/utils/generateTag"
|
||||||
|
|
||||||
import { env } from "@/env/server"
|
import { env } from "@/env/server"
|
||||||
import { badRequest, internalServerError, notFound } from "@/server/errors/next"
|
import { badRequest, internalServerError, notFound } from "@/server/errors/next"
|
||||||
|
|
||||||
import { generateLoyaltyConfigTag } from "@/utils/generateTag"
|
|
||||||
|
|
||||||
import type { NextRequest } from "next/server"
|
import type { NextRequest } from "next/server"
|
||||||
|
|
||||||
enum LoyaltyConfigContentTypes {
|
enum LoyaltyConfigContentTypes {
|
||||||
|
|||||||
@@ -2,12 +2,11 @@ import { revalidateTag } from "next/cache"
|
|||||||
import { headers } from "next/headers"
|
import { headers } from "next/headers"
|
||||||
|
|
||||||
import { getCacheClient } from "@scandic-hotels/common/dataCache"
|
import { getCacheClient } from "@scandic-hotels/common/dataCache"
|
||||||
|
import { generateTag } from "@scandic-hotels/trpc/utils/generateTag"
|
||||||
|
|
||||||
import { env } from "@/env/server"
|
import { env } from "@/env/server"
|
||||||
import { badRequest, internalServerError } from "@/server/errors/next"
|
import { badRequest, internalServerError } from "@/server/errors/next"
|
||||||
|
|
||||||
import { generateTag } from "@/utils/generateTag"
|
|
||||||
|
|
||||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
|
|
||||||
// This file is primarily to be used locally to test
|
// This file is primarily to be used locally to test
|
||||||
|
|||||||
@@ -4,20 +4,19 @@ import { z } from "zod"
|
|||||||
|
|
||||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
import { getCacheClient } from "@scandic-hotels/common/dataCache"
|
import { getCacheClient } from "@scandic-hotels/common/dataCache"
|
||||||
|
import { affix as breadcrumbsAffix } from "@scandic-hotels/trpc/routers/contentstack/breadcrumbs/utils"
|
||||||
import { env } from "@/env/server"
|
import { languageSwitcherAffix } from "@scandic-hotels/trpc/routers/contentstack/languageSwitcher/utils"
|
||||||
import { badRequest, internalServerError } from "@/server/errors/next"
|
import { affix as metadataAffix } from "@scandic-hotels/trpc/routers/contentstack/metadata/utils"
|
||||||
import { affix as breadcrumbsAffix } from "@/server/routers/contentstack/breadcrumbs/utils"
|
import { affix as pageSettingsAffix } from "@scandic-hotels/trpc/routers/contentstack/pageSettings/utils"
|
||||||
import { languageSwitcherAffix } from "@/server/routers/contentstack/languageSwitcher/utils"
|
import { resolveEntryCacheKey } from "@scandic-hotels/trpc/utils/entry"
|
||||||
import { affix as metadataAffix } from "@/server/routers/contentstack/metadata/utils"
|
|
||||||
import { affix as pageSettingsAffix } from "@/server/routers/contentstack/pageSettings/utils"
|
|
||||||
|
|
||||||
import { resolveEntryCacheKey } from "@/utils/entry"
|
|
||||||
import {
|
import {
|
||||||
generateRefsResponseTag,
|
generateRefsResponseTag,
|
||||||
generateRefTag,
|
generateRefTag,
|
||||||
generateTag,
|
generateTag,
|
||||||
} from "@/utils/generateTag"
|
} from "@scandic-hotels/trpc/utils/generateTag"
|
||||||
|
|
||||||
|
import { env } from "@/env/server"
|
||||||
|
import { badRequest, internalServerError } from "@/server/errors/next"
|
||||||
|
|
||||||
import type { NextRequest } from "next/server"
|
import type { NextRequest } from "next/server"
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { type NextRequest, NextResponse } from "next/server"
|
import { type NextRequest, NextResponse } from "next/server"
|
||||||
|
|
||||||
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import { createCounter } from "@scandic-hotels/common/telemetry"
|
import { createCounter } from "@scandic-hotels/common/telemetry"
|
||||||
|
|
||||||
import { env } from "@/env/server"
|
import { env } from "@/env/server"
|
||||||
import { dt } from "@/lib/dt"
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getEntries,
|
getEntries,
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
|
import { type Lang } from "@scandic-hotels/common/constants/language"
|
||||||
import { createCounter } from "@scandic-hotels/common/telemetry"
|
import { createCounter } from "@scandic-hotels/common/telemetry"
|
||||||
|
import { removeTrailingSlash } from "@scandic-hotels/common/utils/url"
|
||||||
|
|
||||||
import { env } from "@/env/server"
|
import { env } from "@/env/server"
|
||||||
|
|
||||||
import { removeTrailingSlash } from "@/utils/url"
|
|
||||||
|
|
||||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
|
||||||
|
|
||||||
import type { SyncItem } from "@/types/sitemap"
|
import type { SyncItem } from "@/types/sitemap"
|
||||||
|
|
||||||
export function mergeEntries(
|
export function mergeEntries(
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import HotelListingItem from "./HotelListingItem"
|
|||||||
|
|
||||||
import styles from "./campaignHotelListing.module.css"
|
import styles from "./campaignHotelListing.module.css"
|
||||||
|
|
||||||
import type { HotelDataWithUrl } from "@/types/hotel"
|
import type { HotelDataWithUrl } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
interface CampaignHotelListingClientProps {
|
interface CampaignHotelListingClientProps {
|
||||||
heading: string
|
heading: string
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { getSingleDecimal } from "@/utils/numberFormatting"
|
|||||||
|
|
||||||
import styles from "./hotelListingItem.module.css"
|
import styles from "./hotelListingItem.module.css"
|
||||||
|
|
||||||
import type { Hotel } from "@/types/hotel"
|
import type { Hotel } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
interface HotelListingItemProps {
|
interface HotelListingItemProps {
|
||||||
hotel: Hotel
|
hotel: Hotel
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
import {
|
||||||
|
CardsGridEnum,
|
||||||
|
CardsGridLayoutEnum,
|
||||||
|
} from "@scandic-hotels/trpc/types/cardsGridEnum"
|
||||||
|
|
||||||
import InfoCard from "@/components/ContentType/StartPage/InfoCard"
|
import InfoCard from "@/components/ContentType/StartPage/InfoCard"
|
||||||
import SectionContainer from "@/components/Section/Container"
|
import SectionContainer from "@/components/Section/Container"
|
||||||
import SectionHeader from "@/components/Section/Header"
|
import SectionHeader from "@/components/Section/Header"
|
||||||
@@ -7,7 +12,6 @@ import LoyaltyCard from "@/components/TempDesignSystem/LoyaltyCard"
|
|||||||
import TeaserCard from "@/components/TempDesignSystem/TeaserCard"
|
import TeaserCard from "@/components/TempDesignSystem/TeaserCard"
|
||||||
|
|
||||||
import type { CardsGridProps } from "@/types/components/blocks/cardsGrid"
|
import type { CardsGridProps } from "@/types/components/blocks/cardsGrid"
|
||||||
import { CardsGridEnum, CardsGridLayoutEnum } from "@/types/enums/cardsGrid"
|
|
||||||
import type { StackableGridProps } from "../TempDesignSystem/Grids/Stackable/stackable"
|
import type { StackableGridProps } from "../TempDesignSystem/Grids/Stackable/stackable"
|
||||||
|
|
||||||
export default function CardsGrid({ cards_grid }: CardsGridProps) {
|
export default function CardsGrid({ cards_grid }: CardsGridProps) {
|
||||||
|
|||||||
@@ -2,10 +2,9 @@
|
|||||||
|
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
|
||||||
import { dt } from "@/lib/dt"
|
|
||||||
|
|
||||||
import Button from "@/components/TempDesignSystem/Button"
|
import Button from "@/components/TempDesignSystem/Button"
|
||||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import {
|
import { MembershipLevelEnum } from "@scandic-hotels/common/constants/membershipLevels"
|
||||||
MembershipLevelEnum,
|
|
||||||
membershipLevels,
|
import { membershipLevels } from "@/constants/membershipLevels"
|
||||||
} from "@/constants/membershipLevels"
|
|
||||||
|
|
||||||
import MembershipLevelIcon from "@/components/Levels/Icon"
|
import MembershipLevelIcon from "@/components/Levels/Icon"
|
||||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import { dt } from "@/lib/dt"
|
|
||||||
|
|
||||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { MembershipLevelEnum } from "@/constants/membershipLevels"
|
import { MembershipLevelEnum } from "@scandic-hotels/common/constants/membershipLevels"
|
||||||
|
|
||||||
import { serverClient } from "@/lib/trpc/server"
|
import { serverClient } from "@/lib/trpc/server"
|
||||||
|
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { useReducer } from "react"
|
import { useReducer } from "react"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import {
|
import { type MembershipLevel } from "@scandic-hotels/common/constants/membershipLevels"
|
||||||
type MembershipLevel,
|
|
||||||
membershipLevels,
|
import { membershipLevels } from "@/constants/membershipLevels"
|
||||||
} from "@/constants/membershipLevels"
|
|
||||||
|
|
||||||
import MembershipLevelIcon from "@/components/Levels/Icon"
|
import MembershipLevelIcon from "@/components/Levels/Icon"
|
||||||
import DeprecatedSelect from "@/components/TempDesignSystem/DeprecatedSelect"
|
import DeprecatedSelect from "@/components/TempDesignSystem/DeprecatedSelect"
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import {
|
import {
|
||||||
type MembershipLevel,
|
type MembershipLevel,
|
||||||
MembershipLevelEnum,
|
MembershipLevelEnum,
|
||||||
} from "@/constants/membershipLevels"
|
} from "@scandic-hotels/common/constants/membershipLevels"
|
||||||
|
|
||||||
import { getSteppedUpLevel } from "@/utils/user"
|
import { getSteppedUpLevel } from "@/utils/user"
|
||||||
|
|
||||||
|
import type { LevelWithRewards } from "@scandic-hotels/trpc/routers/contentstack/loyaltyLevel/output"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
type LevelWithRewards,
|
|
||||||
OverviewTableActionsEnum,
|
OverviewTableActionsEnum,
|
||||||
type OverviewTableClientProps,
|
type OverviewTableClientProps,
|
||||||
type OverviewTableReducerAction,
|
type OverviewTableReducerAction,
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
import { usePathname } from "next/navigation"
|
import { usePathname } from "next/navigation"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
|
|
||||||
import { webviews } from "@/constants/routes/webviews"
|
import { webviews } from "@/constants/routes/webviews"
|
||||||
import { dt } from "@/lib/dt"
|
|
||||||
|
|
||||||
import Link from "@/components/TempDesignSystem/Link"
|
import Link from "@/components/TempDesignSystem/Link"
|
||||||
import Table from "@/components/TempDesignSystem/Table"
|
import Table from "@/components/TempDesignSystem/Table"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { dt } from "@/lib/dt"
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
|
|
||||||
import Table from "@/components/TempDesignSystem/Table"
|
import Table from "@/components/TempDesignSystem/Table"
|
||||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
import { useRef, useState } from "react"
|
import { useRef, useState } from "react"
|
||||||
|
|
||||||
|
import { type Reward } from "@scandic-hotels/trpc/types/rewards"
|
||||||
|
|
||||||
import { REWARDS_PER_PAGE } from "@/constants/rewards"
|
import { REWARDS_PER_PAGE } from "@/constants/rewards"
|
||||||
import { trpc } from "@/lib/trpc/client"
|
import { trpc } from "@/lib/trpc/client"
|
||||||
|
|
||||||
@@ -19,7 +21,6 @@ import Redeem from "../Redeem"
|
|||||||
import styles from "./current.module.css"
|
import styles from "./current.module.css"
|
||||||
|
|
||||||
import type { CurrentRewardsClientProps } from "@/types/components/myPages/myPage/accountPage"
|
import type { CurrentRewardsClientProps } from "@/types/components/myPages/myPage/accountPage"
|
||||||
import type { Reward } from "@/types/components/myPages/rewards"
|
|
||||||
|
|
||||||
export default function ClientCurrentRewards({
|
export default function ClientCurrentRewards({
|
||||||
rewards: initialData,
|
rewards: initialData,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Lock } from "react-feather"
|
import { Lock } from "react-feather"
|
||||||
|
|
||||||
import { MembershipLevelEnum } from "@/constants/membershipLevels"
|
import { MembershipLevelEnum } from "@scandic-hotels/common/constants/membershipLevels"
|
||||||
|
|
||||||
import { getMembershipLevel } from "@/lib/trpc/memoizedRequests"
|
import { getMembershipLevel } from "@/lib/trpc/memoizedRequests"
|
||||||
import { serverClient } from "@/lib/trpc/server"
|
import { serverClient } from "@/lib/trpc/server"
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { RewardIcon } from "../../RewardIcon"
|
|||||||
|
|
||||||
import styles from "../redeem.module.css"
|
import styles from "../redeem.module.css"
|
||||||
|
|
||||||
import type { Campaign } from "@/types/components/myPages/rewards"
|
import type { Campaign } from "@scandic-hotels/trpc/types/rewards"
|
||||||
|
|
||||||
export default function Campaign({ reward }: { reward: Campaign }) {
|
export default function Campaign({ reward }: { reward: Campaign }) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import useRedeemFlow from "../useRedeemFlow"
|
|||||||
|
|
||||||
import styles from "../redeem.module.css"
|
import styles from "../redeem.module.css"
|
||||||
|
|
||||||
import type { Surprise, Tier } from "@/types/components/myPages/rewards"
|
import type { Surprise, Tier } from "@scandic-hotels/trpc/types/rewards"
|
||||||
|
|
||||||
export default function Tier({
|
export default function Tier({
|
||||||
reward,
|
reward,
|
||||||
|
|||||||
@@ -2,10 +2,9 @@
|
|||||||
|
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
|
||||||
import { dt } from "@/lib/dt"
|
|
||||||
|
|
||||||
import Countdown from "@/components/Countdown"
|
import Countdown from "@/components/Countdown"
|
||||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||||
|
|
||||||
|
|||||||
@@ -25,12 +25,13 @@ import { RedeemContext } from "./useRedeemFlow"
|
|||||||
|
|
||||||
import styles from "./redeem.module.css"
|
import styles from "./redeem.module.css"
|
||||||
|
|
||||||
|
import type { Reward } from "@scandic-hotels/trpc/types/rewards"
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
RedeemModalState,
|
RedeemModalState,
|
||||||
RedeemProps,
|
RedeemProps,
|
||||||
RedeemStep,
|
RedeemStep,
|
||||||
} from "@/types/components/myPages/myPage/accountPage"
|
} from "@/types/components/myPages/myPage/accountPage"
|
||||||
import type { Reward } from "@/types/components/myPages/rewards"
|
|
||||||
|
|
||||||
const MotionOverlay = motion.create(ModalOverlay)
|
const MotionOverlay = motion.create(ModalOverlay)
|
||||||
const MotionModal = motion.create(Modal)
|
const MotionModal = motion.create(Modal)
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ import { trpc } from "@/lib/trpc/client"
|
|||||||
|
|
||||||
import { getFirstRedeemableCoupon } from "@/utils/rewards"
|
import { getFirstRedeemableCoupon } from "@/utils/rewards"
|
||||||
|
|
||||||
|
import type { Reward } from "@scandic-hotels/trpc/types/rewards"
|
||||||
|
|
||||||
import type { RedeemFlowContext } from "@/types/components/myPages/myPage/accountPage"
|
import type { RedeemFlowContext } from "@/types/components/myPages/myPage/accountPage"
|
||||||
import type { Reward } from "@/types/components/myPages/rewards"
|
|
||||||
|
|
||||||
export const RedeemContext = createContext<RedeemFlowContext>({
|
export const RedeemContext = createContext<RedeemFlowContext>({
|
||||||
redeemStep: "initial",
|
redeemStep: "initial",
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { REWARD_IDS } from "@/constants/rewards"
|
// import { REWARD_IDS } from "@scandic-hotels/trpc/types/rewards"
|
||||||
|
|
||||||
|
import { REWARD_IDS, type RewardId } from "@scandic-hotels/trpc/types/rewards"
|
||||||
|
|
||||||
import { IconName } from "@/components/Icons/iconName"
|
import { IconName } from "@/components/Icons/iconName"
|
||||||
import { IllustrationByIconName } from "@/components/Icons/IllustrationByIconName"
|
import { IllustrationByIconName } from "@/components/Icons/IllustrationByIconName"
|
||||||
@@ -7,7 +9,7 @@ import { isValidRewardId } from "@/utils/rewards"
|
|||||||
import type { IconProps } from "@scandic-hotels/design-system/Icons"
|
import type { IconProps } from "@scandic-hotels/design-system/Icons"
|
||||||
import type { FC } from "react"
|
import type { FC } from "react"
|
||||||
|
|
||||||
import type { RewardId } from "@/types/components/myPages/rewards"
|
// import type { RewardId } from "@/types/components/myPages/rewards"
|
||||||
|
|
||||||
function getIconForRewardId(rewardId: RewardId): IconName {
|
function getIconForRewardId(rewardId: RewardId): IconName {
|
||||||
switch (rewardId) {
|
switch (rewardId) {
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
import { mapRewardToIcon } from "./data"
|
import { mapRewardToIcon } from "./data"
|
||||||
|
|
||||||
import type { RewardIconProps } from "@/types/components/myPages/rewards"
|
import type { LogoAndIllustrationProps } from "@scandic-hotels/design-system/Icons"
|
||||||
|
|
||||||
|
export interface RewardIconProps extends LogoAndIllustrationProps {
|
||||||
|
rewardId: string
|
||||||
|
iconSize?: "small" | "medium" | "large"
|
||||||
|
}
|
||||||
|
|
||||||
// Original SVG aspect ratio is 358:202 (≈1.77:1)
|
// Original SVG aspect ratio is 358:202 (≈1.77:1)
|
||||||
const sizeMap = {
|
const sizeMap = {
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
|
||||||
import { dt } from "@/lib/dt"
|
|
||||||
|
|
||||||
import Image from "@/components/Image"
|
import Image from "@/components/Image"
|
||||||
import Link from "@/components/TempDesignSystem/Link"
|
import Link from "@/components/TempDesignSystem/Link"
|
||||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { Suspense } from "react"
|
import { Suspense } from "react"
|
||||||
|
|
||||||
|
import { DynamicContentEnum } from "@scandic-hotels/trpc/types/dynamicContent"
|
||||||
|
|
||||||
import { env } from "@/env/server"
|
import { env } from "@/env/server"
|
||||||
|
|
||||||
import HowItWorks from "@/components/Blocks/DynamicContent/HowItWorks"
|
import HowItWorks from "@/components/Blocks/DynamicContent/HowItWorks"
|
||||||
@@ -22,7 +24,6 @@ import LoadingSpinner from "@/components/LoadingSpinner"
|
|||||||
import JobylonFeed from "./JobylonFeed"
|
import JobylonFeed from "./JobylonFeed"
|
||||||
|
|
||||||
import type { DynamicContentProps } from "@/types/components/blocks/dynamicContent"
|
import type { DynamicContentProps } from "@/types/components/blocks/dynamicContent"
|
||||||
import { DynamicContentEnum } from "@/types/enums/dynamicContent"
|
|
||||||
|
|
||||||
export default function DynamicContent(props: DynamicContentProps) {
|
export default function DynamicContent(props: DynamicContentProps) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import IconByCSSelect from "@/components/Icons/IconByCSSelect"
|
|||||||
|
|
||||||
import styles from "./essentials.module.css"
|
import styles from "./essentials.module.css"
|
||||||
|
|
||||||
import type { EssentialsBlock } from "@/types/trpc/routers/contentstack/campaignPage"
|
import type { EssentialsBlock } from "@scandic-hotels/trpc/types/campaignPage"
|
||||||
|
|
||||||
interface EssentialsProps {
|
interface EssentialsProps {
|
||||||
content: EssentialsBlock
|
content: EssentialsBlock
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import type { AdditionalData, Hotel } from "@scandic-hotels/trpc/types/hotel"
|
||||||
import type { IntlShape } from "react-intl"
|
import type { IntlShape } from "react-intl"
|
||||||
|
|
||||||
import type { AdditionalData, Hotel } from "@/types/hotel"
|
|
||||||
import type { HotelListing } from "@/types/trpc/routers/contentstack/blocks"
|
import type { HotelListing } from "@/types/trpc/routers/contentstack/blocks"
|
||||||
|
|
||||||
export function getTypeSpecificInformation(
|
export function getTypeSpecificInformation(
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { Suspense } from "react"
|
import { Suspense } from "react"
|
||||||
|
|
||||||
|
import { BlocksEnums } from "@scandic-hotels/trpc/types/blocks"
|
||||||
|
|
||||||
import CardsGrid from "@/components/Blocks/CardsGrid"
|
import CardsGrid from "@/components/Blocks/CardsGrid"
|
||||||
import CarouselCards from "@/components/Blocks/CarouselCards"
|
import CarouselCards from "@/components/Blocks/CarouselCards"
|
||||||
import DynamicContent from "@/components/Blocks/DynamicContent"
|
import DynamicContent from "@/components/Blocks/DynamicContent"
|
||||||
@@ -17,7 +19,6 @@ import JoinScandicFriends from "./JoinScandicFriends"
|
|||||||
import Table from "./Table"
|
import Table from "./Table"
|
||||||
|
|
||||||
import type { BlocksProps } from "@/types/components/blocks"
|
import type { BlocksProps } from "@/types/components/blocks"
|
||||||
import { BlocksEnums } from "@/types/enums/blocks"
|
|
||||||
|
|
||||||
export default function Blocks({ blocks }: BlocksProps) {
|
export default function Blocks({ blocks }: BlocksProps) {
|
||||||
return blocks.map(async (block, idx) => {
|
return blocks.map(async (block, idx) => {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import { useSearchParams } from "next/navigation"
|
|||||||
import { use, useEffect, useRef, useState } from "react"
|
import { use, useEffect, useRef, useState } from "react"
|
||||||
import { FormProvider, useForm } from "react-hook-form"
|
import { FormProvider, useForm } from "react-hook-form"
|
||||||
|
|
||||||
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
|
||||||
import { REDEMPTION } from "@/constants/booking"
|
import { REDEMPTION } from "@/constants/booking"
|
||||||
import { dt } from "@/lib/dt"
|
|
||||||
import { trpc } from "@/lib/trpc/client"
|
import { trpc } from "@/lib/trpc/client"
|
||||||
import { StickyElementNameEnum } from "@/stores/sticky-position"
|
import { StickyElementNameEnum } from "@/stores/sticky-position"
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import { Button } from "react-aria-components"
|
|||||||
import { useWatch } from "react-hook-form"
|
import { useWatch } from "react-hook-form"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import { shortDateFormat } from "@/constants/dateFormats"
|
import { shortDateFormat } from "@/constants/dateFormats"
|
||||||
import { dt } from "@/lib/dt"
|
|
||||||
|
|
||||||
import SkeletonShimmer from "@/components/SkeletonShimmer"
|
import SkeletonShimmer from "@/components/SkeletonShimmer"
|
||||||
import useLang from "@/hooks/useLang"
|
import useLang from "@/hooks/useLang"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { ImageVaultAsset } from "@/types/components/imageVault"
|
import type { ImageVaultAsset } from "@scandic-hotels/trpc/types/imageVault"
|
||||||
|
|
||||||
export interface ContentCardProps {
|
export interface ContentCardProps {
|
||||||
link?: {
|
link?: {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { getLang } from "@/i18n/serverContext"
|
|||||||
|
|
||||||
import styles from "./topCampaign.module.css"
|
import styles from "./topCampaign.module.css"
|
||||||
|
|
||||||
import { type CampaignOverviewPageData } from "@/types/trpc/routers/contentstack/campaignOverviewPage"
|
import type { CampaignOverviewPageData } from "@scandic-hotels/trpc/types/campaignOverviewPage"
|
||||||
|
|
||||||
interface TopCampaignProps {
|
interface TopCampaignProps {
|
||||||
topCampaign: CampaignOverviewPageData["topCampaign"]
|
topCampaign: CampaignOverviewPageData["topCampaign"]
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { Suspense } from "react"
|
import { Suspense } from "react"
|
||||||
|
|
||||||
|
import { BlocksEnums } from "@scandic-hotels/trpc/types/blocks"
|
||||||
|
|
||||||
import AccordionSection from "@/components/Blocks/Accordion"
|
import AccordionSection from "@/components/Blocks/Accordion"
|
||||||
import CampaignHotelListing from "@/components/Blocks/CampaignHotelListing"
|
import CampaignHotelListing from "@/components/Blocks/CampaignHotelListing"
|
||||||
import CampaignHotelListingSkeleton from "@/components/Blocks/CampaignHotelListing/CampaignHotelListingSkeleton"
|
import CampaignHotelListingSkeleton from "@/components/Blocks/CampaignHotelListing/CampaignHotelListingSkeleton"
|
||||||
@@ -7,7 +9,6 @@ import CarouselCards from "@/components/Blocks/CarouselCards"
|
|||||||
import Essentials from "@/components/Blocks/Essentials"
|
import Essentials from "@/components/Blocks/Essentials"
|
||||||
|
|
||||||
import type { BlocksProps } from "@/types/components/blocks"
|
import type { BlocksProps } from "@/types/components/blocks"
|
||||||
import { BlocksEnums } from "@/types/enums/blocks"
|
|
||||||
|
|
||||||
export default function Blocks({ blocks }: BlocksProps) {
|
export default function Blocks({ blocks }: BlocksProps) {
|
||||||
return blocks.map(async (block) => {
|
return blocks.map(async (block) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import type { Hero } from "@scandic-hotels/trpc/types/campaignPage"
|
||||||
import type { VariantProps } from "class-variance-authority"
|
import type { VariantProps } from "class-variance-authority"
|
||||||
|
|
||||||
import type { Hero } from "@/types/trpc/routers/contentstack/campaignPage"
|
|
||||||
import type { variants } from "./variants"
|
import type { variants } from "./variants"
|
||||||
|
|
||||||
export interface HeroProps
|
export interface HeroProps
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
|
import { BlocksEnums } from "@scandic-hotels/trpc/types/blocks"
|
||||||
|
|
||||||
import { useDestinationDataStore } from "@/stores/destination-data"
|
import { useDestinationDataStore } from "@/stores/destination-data"
|
||||||
|
|
||||||
import AccordionSection from "@/components/Blocks/Accordion"
|
import AccordionSection from "@/components/Blocks/Accordion"
|
||||||
import JsonToHtml from "@/components/JsonToHtml"
|
import JsonToHtml from "@/components/JsonToHtml"
|
||||||
|
|
||||||
import type { BlocksProps } from "@/types/components/blocks"
|
import type { BlocksProps } from "@/types/components/blocks"
|
||||||
import { BlocksEnums } from "@/types/enums/blocks"
|
|
||||||
|
|
||||||
export default function Blocks({ blocks }: BlocksProps) {
|
export default function Blocks({ blocks }: BlocksProps) {
|
||||||
const { activeFilters } = useDestinationDataStore((state) => ({
|
const { activeFilters } = useDestinationDataStore((state) => ({
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import ExperienceList from "../../ExperienceList"
|
|||||||
|
|
||||||
import styles from "./cityListingItem.module.css"
|
import styles from "./cityListingItem.module.css"
|
||||||
|
|
||||||
import type { DestinationCityListItem } from "@/types/trpc/routers/contentstack/destinationCityPage"
|
import type { DestinationCityListItem } from "@scandic-hotels/trpc/types/destinationCityPage"
|
||||||
|
|
||||||
interface CityListingItemProps {
|
interface CityListingItemProps {
|
||||||
city: DestinationCityListItem
|
city: DestinationCityListItem
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { useRef } from "react"
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
import { AlertTypeEnum } from "@scandic-hotels/trpc/types/alertType"
|
||||||
|
|
||||||
import { useDestinationDataStore } from "@/stores/destination-data"
|
import { useDestinationDataStore } from "@/stores/destination-data"
|
||||||
|
|
||||||
@@ -17,8 +18,6 @@ import CityListingSkeleton from "./CityListingSkeleton"
|
|||||||
|
|
||||||
import styles from "./cityListing.module.css"
|
import styles from "./cityListing.module.css"
|
||||||
|
|
||||||
import { AlertTypeEnum } from "@/types/enums/alert"
|
|
||||||
|
|
||||||
export default function CityListing() {
|
export default function CityListing() {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
const scrollRef = useRef<HTMLElement>(null)
|
const scrollRef = useRef<HTMLElement>(null)
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
import { useMediaQuery } from "usehooks-ts"
|
import { useMediaQuery } from "usehooks-ts"
|
||||||
|
|
||||||
|
import { AlertTypeEnum } from "@scandic-hotels/trpc/types/alertType"
|
||||||
|
|
||||||
import Alert from "@/components/TempDesignSystem/Alert"
|
import Alert from "@/components/TempDesignSystem/Alert"
|
||||||
|
|
||||||
import HotelCardCarousel from "../../../HotelCardCarousel"
|
import HotelCardCarousel from "../../../HotelCardCarousel"
|
||||||
@@ -10,8 +12,7 @@ import HotelListItem from "../HotelListItem"
|
|||||||
|
|
||||||
import styles from "./hotelList.module.css"
|
import styles from "./hotelList.module.css"
|
||||||
|
|
||||||
import { AlertTypeEnum } from "@/types/enums/alert"
|
import type { DestinationPagesHotelData } from "@scandic-hotels/trpc/types/hotel"
|
||||||
import type { DestinationPagesHotelData } from "@/types/hotel"
|
|
||||||
|
|
||||||
interface HotelListContentProps {
|
interface HotelListContentProps {
|
||||||
hotelsCount: number
|
hotelsCount: number
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { getVisibleHotels } from "./utils"
|
|||||||
|
|
||||||
import styles from "./hotelList.module.css"
|
import styles from "./hotelList.module.css"
|
||||||
|
|
||||||
import type { DestinationPagesHotelData } from "@/types/hotel"
|
import type { DestinationPagesHotelData } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
export default function HotelList() {
|
export default function HotelList() {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { DestinationPagesHotelData } from "@/types/hotel"
|
import type { DestinationPagesHotelData } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
export function getVisibleHotels(
|
export function getVisibleHotels(
|
||||||
hotels: DestinationPagesHotelData[],
|
hotels: DestinationPagesHotelData[],
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { getSingleDecimal } from "@/utils/numberFormatting"
|
|||||||
|
|
||||||
import styles from "./hotelListItem.module.css"
|
import styles from "./hotelListItem.module.css"
|
||||||
|
|
||||||
import type { DestinationPagesHotelData } from "@/types/hotel"
|
import type { DestinationPagesHotelData } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
export default function HotelListItem(data: DestinationPagesHotelData) {
|
export default function HotelListItem(data: DestinationPagesHotelData) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ import HotelList from "./HotelList"
|
|||||||
|
|
||||||
import styles from "./cityMap.module.css"
|
import styles from "./cityMap.module.css"
|
||||||
|
|
||||||
|
import type { CityLocation } from "@scandic-hotels/trpc/types/locations"
|
||||||
|
|
||||||
import type { MapLocation } from "@/types/components/mapLocation"
|
import type { MapLocation } from "@/types/components/mapLocation"
|
||||||
import type { CityLocation } from "@/types/trpc/routers/hotel/locations"
|
|
||||||
|
|
||||||
interface CityMapProps {
|
interface CityMapProps {
|
||||||
mapId: string
|
mapId: string
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import { notFound } from "next/navigation"
|
import { notFound } from "next/navigation"
|
||||||
import { Suspense } from "react"
|
import { Suspense } from "react"
|
||||||
|
|
||||||
|
import { SortOption } from "@scandic-hotels/trpc/enums/destinationFilterAndSort"
|
||||||
|
import { getFiltersFromHotels } from "@scandic-hotels/trpc/routers/contentstack/metadata/helpers"
|
||||||
|
|
||||||
import { env } from "@/env/server"
|
import { env } from "@/env/server"
|
||||||
import {
|
import {
|
||||||
getDestinationCityPage,
|
getDestinationCityPage,
|
||||||
getHotelsByCityIdentifier,
|
getHotelsByCityIdentifier,
|
||||||
} from "@/lib/trpc/memoizedRequests"
|
} from "@/lib/trpc/memoizedRequests"
|
||||||
import { getFiltersFromHotels } from "@/stores/destination-data/helper"
|
|
||||||
|
|
||||||
import Breadcrumbs from "@/components/Breadcrumbs"
|
import Breadcrumbs from "@/components/Breadcrumbs"
|
||||||
import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton"
|
import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton"
|
||||||
@@ -29,7 +31,6 @@ import DestinationCityPageSkeleton from "./DestinationCityPageSkeleton"
|
|||||||
import styles from "./destinationCityPage.module.css"
|
import styles from "./destinationCityPage.module.css"
|
||||||
|
|
||||||
import type { SortItem } from "@/types/components/destinationFilterAndSort"
|
import type { SortItem } from "@/types/components/destinationFilterAndSort"
|
||||||
import { SortOption } from "@/types/enums/destinationFilterAndSort"
|
|
||||||
|
|
||||||
interface DestinationCityPageProps {
|
interface DestinationCityPageProps {
|
||||||
isMapView: boolean
|
isMapView: boolean
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { AlertTypeEnum } from "@scandic-hotels/trpc/types/alertType"
|
||||||
|
|
||||||
import { useDestinationDataStore } from "@/stores/destination-data"
|
import { useDestinationDataStore } from "@/stores/destination-data"
|
||||||
|
|
||||||
import DestinationFilterAndSort from "@/components/DestinationFilterAndSort"
|
import DestinationFilterAndSort from "@/components/DestinationFilterAndSort"
|
||||||
@@ -13,8 +15,6 @@ import CityListSkeleton from "./CityListSkeleton"
|
|||||||
|
|
||||||
import styles from "./cityList.module.css"
|
import styles from "./cityList.module.css"
|
||||||
|
|
||||||
import { AlertTypeEnum } from "@/types/enums/alert"
|
|
||||||
|
|
||||||
export default function CityList() {
|
export default function CityList() {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
const { activeCities, isLoading } = useDestinationDataStore((state) => ({
|
const { activeCities, isLoading } = useDestinationDataStore((state) => ({
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import ExperienceList from "../../../ExperienceList"
|
|||||||
|
|
||||||
import styles from "./cityListItem.module.css"
|
import styles from "./cityListItem.module.css"
|
||||||
|
|
||||||
import type { DestinationCityListItem } from "@/types/trpc/routers/contentstack/destinationCityPage"
|
import type { DestinationCityListItem } from "@scandic-hotels/trpc/types/destinationCityPage"
|
||||||
|
|
||||||
interface CityListItemProps {
|
interface CityListItemProps {
|
||||||
city: DestinationCityListItem
|
city: DestinationCityListItem
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
import { notFound } from "next/navigation"
|
import { notFound } from "next/navigation"
|
||||||
import { Suspense } from "react"
|
import { Suspense } from "react"
|
||||||
|
|
||||||
|
import { SortOption } from "@scandic-hotels/trpc/enums/destinationFilterAndSort"
|
||||||
|
import { getFiltersFromHotels } from "@scandic-hotels/trpc/routers/contentstack/metadata/helpers"
|
||||||
|
|
||||||
import { env } from "@/env/server"
|
import { env } from "@/env/server"
|
||||||
import {
|
import {
|
||||||
getDestinationCityPagesByCountry,
|
getDestinationCityPagesByCountry,
|
||||||
getDestinationCountryPage,
|
getDestinationCountryPage,
|
||||||
getHotelsByCountry,
|
getHotelsByCountry,
|
||||||
} from "@/lib/trpc/memoizedRequests"
|
} from "@/lib/trpc/memoizedRequests"
|
||||||
import { getFiltersFromHotels } from "@/stores/destination-data/helper"
|
|
||||||
|
|
||||||
import Breadcrumbs from "@/components/Breadcrumbs"
|
import Breadcrumbs from "@/components/Breadcrumbs"
|
||||||
import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton"
|
import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton"
|
||||||
@@ -29,7 +31,6 @@ import DestinationCountryPageSkeleton from "./DestinationCountryPageSkeleton"
|
|||||||
import styles from "./destinationCountryPage.module.css"
|
import styles from "./destinationCountryPage.module.css"
|
||||||
|
|
||||||
import type { SortItem } from "@/types/components/destinationFilterAndSort"
|
import type { SortItem } from "@/types/components/destinationFilterAndSort"
|
||||||
import { SortOption } from "@/types/enums/destinationFilterAndSort"
|
|
||||||
|
|
||||||
interface DestinationCountryPageProps {
|
interface DestinationCountryPageProps {
|
||||||
isMapView: boolean
|
isMapView: boolean
|
||||||
|
|||||||
@@ -6,7 +6,14 @@ import { getIntl } from "@/i18n"
|
|||||||
|
|
||||||
import styles from "./destination.module.css"
|
import styles from "./destination.module.css"
|
||||||
|
|
||||||
import type { DestinationProps } from "@/types/components/destinationOverviewPage/destinationsList/destinationsData"
|
import type { DestinationCountry } from "@scandic-hotels/trpc/types/destinationsData"
|
||||||
|
|
||||||
|
type DestinationProps = {
|
||||||
|
country: string
|
||||||
|
countryUrl: string | undefined
|
||||||
|
numberOfHotels: number
|
||||||
|
cities: DestinationCountry["cities"]
|
||||||
|
}
|
||||||
|
|
||||||
export default async function Destination({
|
export default async function Destination({
|
||||||
country,
|
country,
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ import Destination from "./Destination"
|
|||||||
|
|
||||||
import styles from "./destinationsList.module.css"
|
import styles from "./destinationsList.module.css"
|
||||||
|
|
||||||
import type { DestinationsListProps } from "@/types/components/destinationOverviewPage/destinationsList/destinationsData"
|
import type { DestinationsData } from "@scandic-hotels/trpc/types/destinationsData"
|
||||||
|
|
||||||
|
type DestinationsListProps = {
|
||||||
|
destinations: DestinationsData
|
||||||
|
}
|
||||||
|
|
||||||
export function DestinationsList({ destinations }: DestinationsListProps) {
|
export function DestinationsList({ destinations }: DestinationsListProps) {
|
||||||
const middleIndex = Math.ceil(destinations.length / 2)
|
const middleIndex = Math.ceil(destinations.length / 2)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import HotelMapCard from "../HotelMapCard"
|
|||||||
|
|
||||||
import styles from "./hotelCardCarousel.module.css"
|
import styles from "./hotelCardCarousel.module.css"
|
||||||
|
|
||||||
import type { DestinationPagesHotelData } from "@/types/hotel"
|
import type { DestinationPagesHotelData } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
interface MapCardCarouselProps {
|
interface MapCardCarouselProps {
|
||||||
visibleHotels: DestinationPagesHotelData[]
|
visibleHotels: DestinationPagesHotelData[]
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import { getSingleDecimal } from "@/utils/numberFormatting"
|
|||||||
|
|
||||||
import styles from "./hotelListingItem.module.css"
|
import styles from "./hotelListingItem.module.css"
|
||||||
|
|
||||||
import type { DestinationPagesHotelData } from "@/types/hotel"
|
import type { DestinationPagesHotelData } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
export default function HotelListingItem(data: DestinationPagesHotelData) {
|
export default function HotelListingItem(data: DestinationPagesHotelData) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { useIntl } from "react-intl"
|
|||||||
|
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
import { AlertTypeEnum } from "@scandic-hotels/trpc/types/alertType"
|
||||||
|
|
||||||
import { useDestinationDataStore } from "@/stores/destination-data"
|
import { useDestinationDataStore } from "@/stores/destination-data"
|
||||||
|
|
||||||
@@ -21,8 +22,6 @@ import HotelListingSkeleton from "./HotelListingSkeleton"
|
|||||||
|
|
||||||
import styles from "./hotelListing.module.css"
|
import styles from "./hotelListing.module.css"
|
||||||
|
|
||||||
import { AlertTypeEnum } from "@/types/enums/alert"
|
|
||||||
|
|
||||||
export default function HotelListing() {
|
export default function HotelListing() {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
const scrollRef = useRef<HTMLElement>(null)
|
const scrollRef = useRef<HTMLElement>(null)
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ import DialogImage from "./DialogImage"
|
|||||||
|
|
||||||
import styles from "./hotelMapCard.module.css"
|
import styles from "./hotelMapCard.module.css"
|
||||||
|
|
||||||
|
import type { Amenities } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
import type { GalleryImage } from "@/types/components/imageGallery"
|
import type { GalleryImage } from "@/types/components/imageGallery"
|
||||||
import type { Amenities } from "@/types/hotel"
|
|
||||||
|
|
||||||
interface HotelMapCardProps {
|
interface HotelMapCardProps {
|
||||||
amenities: Amenities
|
amenities: Amenities
|
||||||
|
|||||||
@@ -29,8 +29,9 @@ import { getHotelMapMarkers, mapMarkerDataToGeoJson } from "./utils"
|
|||||||
|
|
||||||
import styles from "./map.module.css"
|
import styles from "./map.module.css"
|
||||||
|
|
||||||
|
import type { DestinationPagesHotelData } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
import type { MapLocation } from "@/types/components/mapLocation"
|
import type { MapLocation } from "@/types/components/mapLocation"
|
||||||
import type { DestinationPagesHotelData } from "@/types/hotel"
|
|
||||||
|
|
||||||
interface MapProps {
|
interface MapProps {
|
||||||
hotels: DestinationPagesHotelData[]
|
hotels: DestinationPagesHotelData[]
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
import type { DestinationPagesHotelData } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
DestinationMarker,
|
DestinationMarker,
|
||||||
MarkerFeature,
|
MarkerFeature,
|
||||||
MarkerGeojson,
|
MarkerGeojson,
|
||||||
} from "@/types/components/maps/destinationMarkers"
|
} from "@/types/components/maps/destinationMarkers"
|
||||||
import type { DestinationPagesHotelData } from "@/types/hotel"
|
|
||||||
|
|
||||||
export function mapMarkerDataToGeoJson(markers: DestinationMarker[]) {
|
export function mapMarkerDataToGeoJson(markers: DestinationMarker[]) {
|
||||||
const features = markers.map<MarkerFeature>(
|
const features = markers.map<MarkerFeature>(
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import Button from "@/components/TempDesignSystem/Button"
|
|||||||
import SidePeek from "@/components/TempDesignSystem/SidePeek"
|
import SidePeek from "@/components/TempDesignSystem/SidePeek"
|
||||||
import { trackOpenSidePeekOnDestinationPagesEvent } from "@/utils/tracking/destinationPage"
|
import { trackOpenSidePeekOnDestinationPagesEvent } from "@/utils/tracking/destinationPage"
|
||||||
|
|
||||||
import type { DestinationCityPageData } from "@/types/trpc/routers/contentstack/destinationCityPage"
|
import type { DestinationCityPageData } from "@scandic-hotels/trpc/types/destinationCityPage"
|
||||||
import type { DestinationCountryPageData } from "@/types/trpc/routers/contentstack/destinationCountryPage"
|
import type { DestinationCountryPageData } from "@scandic-hotels/trpc/types/destinationCountryPage"
|
||||||
|
|
||||||
interface DestinationPageSidepeekProps {
|
interface DestinationPageSidepeekProps {
|
||||||
buttonText?: string | null
|
buttonText?: string | null
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { mapImageVaultImagesToGalleryImages } from "@/utils/imageGallery"
|
|||||||
|
|
||||||
import styles from "./topImages.module.css"
|
import styles from "./topImages.module.css"
|
||||||
|
|
||||||
import type { ImageVaultAsset } from "@/types/components/imageVault"
|
import type { ImageVaultAsset } from "@scandic-hotels/trpc/types/imageVault"
|
||||||
|
|
||||||
interface TopImageProps {
|
interface TopImageProps {
|
||||||
images: ImageVaultAsset[]
|
images: ImageVaultAsset[]
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
|
import type { CategorizedFilters } from "@scandic-hotels/trpc/types/destinationFilterAndSort"
|
||||||
import type { IntlShape } from "react-intl"
|
import type { IntlShape } from "react-intl"
|
||||||
|
|
||||||
import type { CategorizedFilters } from "@/types/components/destinationFilterAndSort"
|
|
||||||
|
|
||||||
export function getHeadingText(
|
export function getHeadingText(
|
||||||
intl: IntlShape,
|
intl: IntlShape,
|
||||||
location: string,
|
location: string,
|
||||||
|
|||||||
@@ -20,9 +20,10 @@ import Sidebar from "./Sidebar"
|
|||||||
|
|
||||||
import styles from "./hotelMapPage.module.css"
|
import styles from "./hotelMapPage.module.css"
|
||||||
|
|
||||||
|
import type { PointOfInterest } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
import type { MarkerInfo } from "@scandic-hotels/trpc/types/marker"
|
||||||
|
|
||||||
import type { Coordinates } from "@/types/components/maps/coordinates"
|
import type { Coordinates } from "@/types/components/maps/coordinates"
|
||||||
import type { MarkerInfo } from "@/types/components/maps/marker"
|
|
||||||
import type { PointOfInterest } from "@/types/hotel"
|
|
||||||
|
|
||||||
interface HotelMapPageClientProps {
|
interface HotelMapPageClientProps {
|
||||||
apiKey: string
|
apiKey: string
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { Button as ButtonRAC } from "react-aria-components"
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
import { PointOfInterestGroupEnum } from "@scandic-hotels/trpc/enums/pointOfInterest"
|
||||||
|
|
||||||
import PoiMarker from "@/components/Maps/Markers/Poi"
|
import PoiMarker from "@/components/Maps/Markers/Poi"
|
||||||
|
|
||||||
@@ -14,7 +15,6 @@ import styles from "./sidebar.module.css"
|
|||||||
|
|
||||||
import type { SidebarProps } from "@/types/components/hotelPage/map/sidebar"
|
import type { SidebarProps } from "@/types/components/hotelPage/map/sidebar"
|
||||||
import type { Coordinates } from "@/types/components/maps/coordinates"
|
import type { Coordinates } from "@/types/components/maps/coordinates"
|
||||||
import { PointOfInterestGroupEnum } from "@/types/enums/pointOfInterest"
|
|
||||||
|
|
||||||
export default function Sidebar({
|
export default function Sidebar({
|
||||||
activePoi,
|
activePoi,
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import CardImage from "./CardImage"
|
|||||||
|
|
||||||
import styles from "./cardGrid.module.css"
|
import styles from "./cardGrid.module.css"
|
||||||
|
|
||||||
import type { ActivityCard } from "@/types/trpc/routers/contentstack/hotelPage"
|
import type { ActivityCard } from "@scandic-hotels/trpc/types/hotelPage"
|
||||||
|
|
||||||
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
|
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
|
||||||
|
|
||||||
export default function ActivitiesCardGrid(activitiesCard: ActivityCard) {
|
export default function ActivitiesCardGrid(activitiesCard: ActivityCard) {
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ import { getIntl } from "@/i18n"
|
|||||||
|
|
||||||
import styles from "./tripAdvisorLink.module.css"
|
import styles from "./tripAdvisorLink.module.css"
|
||||||
|
|
||||||
|
import type { HotelTripAdvisor } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
import { SidepeekSlugs } from "@/types/components/hotelPage/hotelPage"
|
import { SidepeekSlugs } from "@/types/components/hotelPage/hotelPage"
|
||||||
import type { HotelTripAdvisor } from "@/types/hotel"
|
|
||||||
|
|
||||||
interface TripAdvisorLinkProps {
|
interface TripAdvisorLinkProps {
|
||||||
tripAdvisor: NonNullable<HotelTripAdvisor>
|
tripAdvisor: NonNullable<HotelTripAdvisor>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type {
|
|||||||
HotelAddress,
|
HotelAddress,
|
||||||
HotelLocation,
|
HotelLocation,
|
||||||
HotelTripAdvisor,
|
HotelTripAdvisor,
|
||||||
} from "@/types/hotel"
|
} from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
export type IntroSectionProps = {
|
export type IntroSectionProps = {
|
||||||
address: HotelAddress
|
address: HotelAddress
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import FacebookIcon from "@scandic-hotels/design-system/Icons/FacebookIcon"
|
import FacebookIcon from "@scandic-hotels/design-system/Icons/FacebookIcon"
|
||||||
import InstagramIcon from "@scandic-hotels/design-system/Icons/InstagramIcon"
|
import InstagramIcon from "@scandic-hotels/design-system/Icons/InstagramIcon"
|
||||||
|
import { Country } from "@scandic-hotels/trpc/types/country"
|
||||||
|
|
||||||
import Image from "@/components/Image"
|
import Image from "@/components/Image"
|
||||||
import Link from "@/components/TempDesignSystem/Link"
|
import Link from "@/components/TempDesignSystem/Link"
|
||||||
@@ -13,7 +14,6 @@ import { getLang } from "@/i18n/serverContext"
|
|||||||
import styles from "./contactInformation.module.css"
|
import styles from "./contactInformation.module.css"
|
||||||
|
|
||||||
import type { ContactInformationProps } from "@/types/components/hotelPage/sidepeek/aboutTheHotel"
|
import type { ContactInformationProps } from "@/types/components/hotelPage/sidepeek/aboutTheHotel"
|
||||||
import { Country } from "@/types/enums/country"
|
|
||||||
|
|
||||||
export default async function ContactInformation({
|
export default async function ContactInformation({
|
||||||
hotelAddress,
|
hotelAddress,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Image from "@/components/Image"
|
|||||||
|
|
||||||
import styles from "./images.module.css"
|
import styles from "./images.module.css"
|
||||||
|
|
||||||
import type { ApiImage } from "@/types/hotel"
|
import type { ApiImage } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
interface SidePeekImagesProps {
|
interface SidePeekImagesProps {
|
||||||
images: ApiImage[]
|
images: ApiImage[]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import ShowMoreButton from "@/components/TempDesignSystem/ShowMoreButton"
|
|||||||
|
|
||||||
import styles from "./roomFacilities.module.css"
|
import styles from "./roomFacilities.module.css"
|
||||||
|
|
||||||
import type { Room } from "@/types/hotel"
|
import type { Room } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
interface RoomFacilitiesProps {
|
interface RoomFacilitiesProps {
|
||||||
roomFacilities: Room["roomFacilities"]
|
roomFacilities: Room["roomFacilities"]
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import getFilteredRoomTypes from "./utils"
|
|||||||
|
|
||||||
import styles from "./roomTypes.module.css"
|
import styles from "./roomTypes.module.css"
|
||||||
|
|
||||||
import type { Room } from "@/types/hotel"
|
import type { Room } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
interface RoomFacilitiesProps {
|
interface RoomFacilitiesProps {
|
||||||
roomTypes: Room["roomTypes"]
|
roomTypes: Room["roomTypes"]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Room } from "@/types/hotel"
|
import type { Room } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
type RoomType = Room["roomTypes"][number]
|
type RoomType = Room["roomTypes"][number]
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
|
|
||||||
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import { selectRateWithParams } from "@/constants/routes/hotelReservation"
|
import { selectRateWithParams } from "@/constants/routes/hotelReservation"
|
||||||
import { dt } from "@/lib/dt"
|
|
||||||
|
|
||||||
import ImageGallery from "@/components/ImageGallery"
|
import ImageGallery from "@/components/ImageGallery"
|
||||||
import Button from "@/components/TempDesignSystem/Button"
|
import Button from "@/components/TempDesignSystem/Button"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
|
import type { Room } from "@scandic-hotels/trpc/types/hotel"
|
||||||
import type { IntlShape } from "react-intl"
|
import type { IntlShape } from "react-intl"
|
||||||
|
|
||||||
import type { Room } from "@/types/hotel"
|
|
||||||
|
|
||||||
export function getBedDescriptionText(
|
export function getBedDescriptionText(
|
||||||
intl: IntlShape,
|
intl: IntlShape,
|
||||||
bed: Room["roomTypes"][number]["mainBed"]
|
bed: Room["roomTypes"][number]["mainBed"]
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ import { getLang } from "@/i18n/serverContext"
|
|||||||
|
|
||||||
import styles from "./tripAdvisor.module.css"
|
import styles from "./tripAdvisor.module.css"
|
||||||
|
|
||||||
|
import type { HotelRatings } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
import { SidepeekSlugs } from "@/types/components/hotelPage/hotelPage"
|
import { SidepeekSlugs } from "@/types/components/hotelPage/hotelPage"
|
||||||
import type { HotelRatings } from "@/types/hotel"
|
|
||||||
|
|
||||||
type TripAdvisorSidePeekProps = {
|
type TripAdvisorSidePeekProps = {
|
||||||
hotelName: string
|
hotelName: string
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { FacilityEnum } from "@scandic-hotels/trpc/enums/facilities"
|
||||||
|
|
||||||
import { IconByIconName } from "@/components/Icons/IconByIconName"
|
import { IconByIconName } from "@/components/Icons/IconByIconName"
|
||||||
import { IconName } from "@/components/Icons/iconName"
|
import { IconName } from "@/components/Icons/iconName"
|
||||||
|
|
||||||
@@ -8,8 +10,6 @@ import type {
|
|||||||
import type { MaterialIconSetIconProps } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import type { MaterialIconSetIconProps } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import type { JSX } from "react"
|
import type { JSX } from "react"
|
||||||
|
|
||||||
import { FacilityEnum } from "@/types/enums/facilities"
|
|
||||||
|
|
||||||
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,
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
|
import type { Hotel, HotelData } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
import type { HotelPage } from "@scandic-hotels/trpc/types/hotelPage"
|
||||||
import type { IntlShape } from "react-intl"
|
import type { IntlShape } from "react-intl"
|
||||||
|
|
||||||
import { HealthFacilitiesEnum } from "@/types/components/hotelPage/facilities"
|
import { HealthFacilitiesEnum } from "@/types/components/hotelPage/facilities"
|
||||||
@@ -12,8 +14,6 @@ import {
|
|||||||
type TrackingSDKPageData,
|
type TrackingSDKPageData,
|
||||||
} from "@/types/components/tracking"
|
} from "@/types/components/tracking"
|
||||||
import { HotelHashValues } from "@/types/enums/hotelPage"
|
import { HotelHashValues } from "@/types/enums/hotelPage"
|
||||||
import type { Hotel, HotelData } from "@/types/hotel"
|
|
||||||
import type { HotelPage } from "@/types/trpc/routers/contentstack/hotelPage"
|
|
||||||
|
|
||||||
export function getRoomNameAsParam(roomName: string) {
|
export function getRoomNameAsParam(roomName: string) {
|
||||||
return roomName
|
return roomName
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import HtmlContent from "../HtmlContent"
|
|||||||
|
|
||||||
import styles from "./accessibilitySubpage.module.css"
|
import styles from "./accessibilitySubpage.module.css"
|
||||||
|
|
||||||
import type { AdditionalData } from "@/types/hotel"
|
import type { AdditionalData } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
interface AccessibilitySubpageProps {
|
interface AccessibilitySubpageProps {
|
||||||
hotelName: string
|
hotelName: string
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/Bread
|
|||||||
|
|
||||||
import styles from "./heroHeader.module.css"
|
import styles from "./heroHeader.module.css"
|
||||||
|
|
||||||
import type { ApiImage } from "@/types/hotel"
|
import type { ApiImage } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
interface HeroHeaderProps {
|
interface HeroHeaderProps {
|
||||||
breadcrumbsTitle: string
|
breadcrumbsTitle: string
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import MeetingsAdditionalContent from "./MeetingRooms"
|
|||||||
|
|
||||||
import styles from "./meetingsSubpage.module.css"
|
import styles from "./meetingsSubpage.module.css"
|
||||||
|
|
||||||
import type { AdditionalData, Hotel } from "@/types/hotel"
|
import type { AdditionalData, Hotel } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
interface MeetingsSubpageProps {
|
interface MeetingsSubpageProps {
|
||||||
hotelId: string
|
hotelId: string
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import ParkingSidebar from "../Sidebar/ParkingSidebar"
|
|||||||
|
|
||||||
import styles from "./parkingSubpage.module.css"
|
import styles from "./parkingSubpage.module.css"
|
||||||
|
|
||||||
import type { AdditionalData, Hotel } from "@/types/hotel"
|
import type { AdditionalData, Hotel } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
interface ParkingSubpageProps {
|
interface ParkingSubpageProps {
|
||||||
hotel: Hotel
|
hotel: Hotel
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import RestaurantSidebar from "../Sidebar/RestaurantSidebar"
|
|||||||
|
|
||||||
import styles from "./restaurantSubpage.module.css"
|
import styles from "./restaurantSubpage.module.css"
|
||||||
|
|
||||||
import type { Hotel, Restaurant } from "@/types/hotel"
|
import type { Hotel, Restaurant } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
interface RestaurantSubpageProps {
|
interface RestaurantSubpageProps {
|
||||||
restaurant: Restaurant
|
restaurant: Restaurant
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user