fix(BOOK-559): Using same ContactInformation component on hotel pages and booking flow inside the hotel details sidepeek
Approved-by: Bianca Widstam
This commit is contained in:
@@ -3,6 +3,7 @@ import { TRPCError } from "@trpc/server"
|
|||||||
import { unstable_noStore as noStore } from "next/cache"
|
import { unstable_noStore as noStore } from "next/cache"
|
||||||
import { NextResponse } from "next/server"
|
import { NextResponse } from "next/server"
|
||||||
|
|
||||||
|
import { Country } from "@scandic-hotels/common/constants/country"
|
||||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
import { equalsIgnoreCaseAndAccents } from "@scandic-hotels/common/utils/stringEquals"
|
import { equalsIgnoreCaseAndAccents } from "@scandic-hotels/common/utils/stringEquals"
|
||||||
import {
|
import {
|
||||||
@@ -10,7 +11,6 @@ import {
|
|||||||
httpStatusByErrorCode,
|
httpStatusByErrorCode,
|
||||||
notFound,
|
notFound,
|
||||||
} from "@scandic-hotels/trpc/errors"
|
} from "@scandic-hotels/trpc/errors"
|
||||||
import { Country } from "@scandic-hotels/trpc/types/country"
|
|
||||||
import {
|
import {
|
||||||
isCityLocation,
|
isCityLocation,
|
||||||
isHotelLocation,
|
isHotelLocation,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { TRPCError } from "@trpc/server"
|
|||||||
import { unstable_noStore as noStore } from "next/cache"
|
import { unstable_noStore as noStore } from "next/cache"
|
||||||
import { NextResponse } from "next/server"
|
import { NextResponse } from "next/server"
|
||||||
|
|
||||||
|
import { Country } from "@scandic-hotels/common/constants/country"
|
||||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
import { equalsIgnoreCaseAndAccents } from "@scandic-hotels/common/utils/stringEquals"
|
import { equalsIgnoreCaseAndAccents } from "@scandic-hotels/common/utils/stringEquals"
|
||||||
import {
|
import {
|
||||||
@@ -10,7 +11,6 @@ import {
|
|||||||
httpStatusByErrorCode,
|
httpStatusByErrorCode,
|
||||||
notFound,
|
notFound,
|
||||||
} from "@scandic-hotels/trpc/errors"
|
} from "@scandic-hotels/trpc/errors"
|
||||||
import { Country } from "@scandic-hotels/trpc/types/country"
|
|
||||||
import {
|
import {
|
||||||
isCityLocation,
|
isCityLocation,
|
||||||
isHotelLocation,
|
isHotelLocation,
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { cx } from "class-variance-authority"
|
import { cx } from "class-variance-authority"
|
||||||
|
|
||||||
|
import { Country } from "@scandic-hotels/common/constants/country"
|
||||||
import { getSingleDecimal } from "@scandic-hotels/common/utils/numberFormatting"
|
import { getSingleDecimal } from "@scandic-hotels/common/utils/numberFormatting"
|
||||||
import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
|
import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
|
||||||
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 { LocalCallCharges } from "@scandic-hotels/design-system/LocalCallCharges"
|
||||||
import { TextLink } from "@scandic-hotels/design-system/TextLink"
|
import { TextLink } from "@scandic-hotels/design-system/TextLink"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
import { Country } from "@scandic-hotels/trpc/types/country"
|
|
||||||
|
|
||||||
import LocalCallCharges from "@/components/LocalCallCharges"
|
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
|
|
||||||
import TripAdvisorSection from "./TripAdvisorSection"
|
import TripAdvisorSection from "./TripAdvisorSection"
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
|
import { ContactInformation } from "@scandic-hotels/booking-flow/components/HotelDetails/ContactInformation"
|
||||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||||
import SidePeek from "@scandic-hotels/design-system/SidePeek"
|
import SidePeek from "@scandic-hotels/design-system/SidePeek"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
|
|
||||||
import ContactInformation from "./ContactInformation"
|
|
||||||
|
|
||||||
import styles from "./aboutTheHotel.module.css"
|
import styles from "./aboutTheHotel.module.css"
|
||||||
|
|
||||||
import { SidepeekSlugs } from "@/types/components/hotelPage/hotelPage"
|
import { SidepeekSlugs } from "@/types/components/hotelPage/hotelPage"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
import { LocalCallCharges } from "@scandic-hotels/design-system/LocalCallCharges"
|
||||||
import { TextLink } from "@scandic-hotels/design-system/TextLink"
|
import { TextLink } from "@scandic-hotels/design-system/TextLink"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import LocalCallCharges from "@/components/LocalCallCharges"
|
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
|
|
||||||
import styles from "./sidebar.module.css"
|
import styles from "./sidebar.module.css"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
import { LocalCallCharges } from "@scandic-hotels/design-system/LocalCallCharges"
|
||||||
import { TextLink } from "@scandic-hotels/design-system/TextLink"
|
import { TextLink } from "@scandic-hotels/design-system/TextLink"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import LocalCallCharges from "@/components/LocalCallCharges"
|
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
|
|
||||||
import styles from "./sidebar.module.css"
|
import styles from "./sidebar.module.css"
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
|
import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
import { LocalCallCharges } from "@scandic-hotels/design-system/LocalCallCharges"
|
||||||
import OpeningHours from "@scandic-hotels/design-system/OpeningHours"
|
import OpeningHours from "@scandic-hotels/design-system/OpeningHours"
|
||||||
import { TextLink } from "@scandic-hotels/design-system/TextLink"
|
import { TextLink } from "@scandic-hotels/design-system/TextLink"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import LocalCallCharges from "@/components/LocalCallCharges"
|
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
|
|
||||||
import styles from "./sidebar.module.css"
|
import styles from "./sidebar.module.css"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
import { LocalCallCharges } from "@scandic-hotels/design-system/LocalCallCharges"
|
||||||
import Link from "@scandic-hotels/design-system/OldDSLink"
|
import Link from "@scandic-hotels/design-system/OldDSLink"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import LocalCallCharges from "@/components/LocalCallCharges"
|
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
|
|
||||||
import OpeningHours from "../../HotelPage/SidePeeks/WellnessAndExercise/Facility/OpeningHours"
|
import OpeningHours from "../../HotelPage/SidePeeks/WellnessAndExercise/Facility/OpeningHours"
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import { cache } from "@/utils/cache"
|
|||||||
|
|
||||||
import { serverClient } from "../server"
|
import { serverClient } from "../server"
|
||||||
|
|
||||||
|
import type { Country } from "@scandic-hotels/common/constants/country"
|
||||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
import type { GetHotelsByCSFilterInput } from "@scandic-hotels/trpc/routers/hotels/input"
|
import type { GetHotelsByCSFilterInput } from "@scandic-hotels/trpc/routers/hotels/input"
|
||||||
import type { GetSavedPaymentCardsInput } from "@scandic-hotels/trpc/routers/user/input"
|
import type { GetSavedPaymentCardsInput } from "@scandic-hotels/trpc/routers/user/input"
|
||||||
import type { Country } from "@scandic-hotels/trpc/types/country"
|
|
||||||
import type { HotelInput } from "@scandic-hotels/trpc/types/hotel"
|
import type { HotelInput } from "@scandic-hotels/trpc/types/hotel"
|
||||||
import type {
|
import type {
|
||||||
AncillaryPackagesInput,
|
AncillaryPackagesInput,
|
||||||
|
|||||||
@@ -8,8 +8,3 @@ export type AboutTheHotelSidePeekProps = {
|
|||||||
descriptions: Hotel["hotelContent"]["texts"]
|
descriptions: Hotel["hotelContent"]["texts"]
|
||||||
hotelName: Hotel["name"]
|
hotelName: Hotel["name"]
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ContactInformationProps = Omit<
|
|
||||||
AboutTheHotelSidePeekProps,
|
|
||||||
"descriptions"
|
|
||||||
>
|
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
.wrapper {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
grid-template-rows: auto;
|
|
||||||
gap: var(--Space-x2);
|
|
||||||
font-family: var(--typography-Body-Regular-fontFamily);
|
|
||||||
margin-bottom: var(--Space-x3);
|
|
||||||
}
|
|
||||||
|
|
||||||
.address,
|
|
||||||
.contactInfo {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: subgrid;
|
|
||||||
grid-template-rows: subgrid;
|
|
||||||
grid-column: 1 / 3;
|
|
||||||
grid-row: 1 / 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.contactInfo > li {
|
|
||||||
font-style: normal;
|
|
||||||
list-style-type: none;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.soMeIcons {
|
|
||||||
display: flex;
|
|
||||||
gap: var(--Space-x15);
|
|
||||||
}
|
|
||||||
|
|
||||||
.ecoLabel {
|
|
||||||
width: 38px;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ecoLabel img {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
flex-shrink: 0;
|
|
||||||
grid-column: 1 / 3;
|
|
||||||
grid-row: 4 / 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ecoContainer {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
column-gap: var(--Space-x15);
|
|
||||||
grid-column: 1 / 3;
|
|
||||||
grid-row: 4 / 4;
|
|
||||||
font-size: var(--typography-Footnote-Regular-fontSize);
|
|
||||||
line-height: ();
|
|
||||||
margin-bottom: var(--Space-x1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.ecoLabelText {
|
|
||||||
display: flex;
|
|
||||||
color: var(--UI-Text-Medium-contrast);
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
@@ -1,159 +0,0 @@
|
|||||||
"use client"
|
|
||||||
|
|
||||||
import { useIntl } from "react-intl"
|
|
||||||
|
|
||||||
import FacebookIcon from "@scandic-hotels/design-system/Icons/FacebookIcon"
|
|
||||||
import InstagramIcon from "@scandic-hotels/design-system/Icons/InstagramIcon"
|
|
||||||
import Image from "@scandic-hotels/design-system/Image"
|
|
||||||
import Link from "@scandic-hotels/design-system/OldDSLink"
|
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
|
||||||
|
|
||||||
import useLang from "../../hooks/useLang"
|
|
||||||
|
|
||||||
import styles from "./contact.module.css"
|
|
||||||
|
|
||||||
import type { Hotel } from "@scandic-hotels/trpc/types/hotel"
|
|
||||||
|
|
||||||
interface ContactProps {
|
|
||||||
hotel: Hotel
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Contact({ hotel }: ContactProps) {
|
|
||||||
const lang = useLang()
|
|
||||||
const intl = useIntl()
|
|
||||||
|
|
||||||
const addressStr = `${hotel.address.streetAddress}, `
|
|
||||||
const cityStr = hotel.address.city
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section className={styles.wrapper}>
|
|
||||||
<address className={styles.address}>
|
|
||||||
<ul className={styles.contactInfo}>
|
|
||||||
<li>
|
|
||||||
<Typography variant="Body/Paragraph/mdBold">
|
|
||||||
<p>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: "common.address",
|
|
||||||
defaultMessage: "Address",
|
|
||||||
})}
|
|
||||||
</p>
|
|
||||||
</Typography>
|
|
||||||
<Typography variant="Body/Paragraph/mdRegular">
|
|
||||||
<p>
|
|
||||||
{addressStr}
|
|
||||||
<br />
|
|
||||||
{cityStr}
|
|
||||||
</p>
|
|
||||||
</Typography>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<Typography variant="Body/Paragraph/mdBold">
|
|
||||||
<p>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: "common.drivingDirections",
|
|
||||||
defaultMessage: "Driving directions",
|
|
||||||
})}
|
|
||||||
</p>
|
|
||||||
</Typography>
|
|
||||||
<Link
|
|
||||||
href={`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(
|
|
||||||
`${hotel.name}, ${hotel.address.streetAddress}, ${hotel.address.zipCode} ${hotel.address.city}`
|
|
||||||
)}`}
|
|
||||||
>
|
|
||||||
<Typography variant="Body/Underline/md">
|
|
||||||
<p>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: "common.googleMaps",
|
|
||||||
defaultMessage: "Google Maps",
|
|
||||||
})}
|
|
||||||
</p>
|
|
||||||
</Typography>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<Typography variant="Body/Paragraph/mdBold">
|
|
||||||
<p>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: "common.contactUs",
|
|
||||||
defaultMessage: "Contact us",
|
|
||||||
})}
|
|
||||||
</p>
|
|
||||||
</Typography>
|
|
||||||
<Link href={`tel:${hotel.contactInformation.phoneNumber}`}>
|
|
||||||
<Typography variant="Body/Underline/md">
|
|
||||||
<p>{hotel.contactInformation.phoneNumber}</p>
|
|
||||||
</Typography>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
{(hotel.socialMedia.facebook || hotel.socialMedia.instagram) && (
|
|
||||||
<>
|
|
||||||
<Typography variant="Body/Paragraph/mdBold">
|
|
||||||
<p>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: "common.followUs",
|
|
||||||
defaultMessage: "Follow us",
|
|
||||||
})}
|
|
||||||
</p>
|
|
||||||
</Typography>
|
|
||||||
<div className={styles.soMeIcons}>
|
|
||||||
{hotel.socialMedia.instagram && (
|
|
||||||
<Link href={hotel.socialMedia.instagram} target="_blank">
|
|
||||||
<InstagramIcon color="Icon/Interactive/Default" />
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
{hotel.socialMedia.facebook && (
|
|
||||||
<Link href={hotel.socialMedia.facebook} target="_blank">
|
|
||||||
<FacebookIcon color="Icon/Interactive/Default" />
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<Typography variant="Body/Paragraph/mdBold">
|
|
||||||
<p>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: "common.email",
|
|
||||||
defaultMessage: "Email",
|
|
||||||
})}
|
|
||||||
</p>
|
|
||||||
</Typography>
|
|
||||||
<Link href={`mailto:${hotel.contactInformation.email}`}>
|
|
||||||
<Typography variant="Body/Underline/md">
|
|
||||||
<p>{hotel.contactInformation.email}</p>
|
|
||||||
</Typography>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</address>
|
|
||||||
{hotel.hotelFacts.ecoLabels?.nordicEcoLabel ? (
|
|
||||||
<div className={styles.ecoContainer}>
|
|
||||||
<div className={styles.ecoLabel}>
|
|
||||||
<Image
|
|
||||||
height={38}
|
|
||||||
width={38}
|
|
||||||
alt={intl.formatMessage({
|
|
||||||
id: "common.nordicSwanEcolabel",
|
|
||||||
defaultMessage: "Nordic Swan Ecolabel",
|
|
||||||
})}
|
|
||||||
src={`/_static/shared/icons/swan-eco/swan_eco_dark_${lang}.png`}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className={styles.ecoLabelText}>
|
|
||||||
<span>
|
|
||||||
{intl.formatMessage({
|
|
||||||
id: "common.nordicSwanEcolabel",
|
|
||||||
defaultMessage: "Nordic Swan Ecolabel",
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
{hotel.hotelFacts.ecoLabels.svanenEcoLabelCertificateNumber}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
</section>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,28 +1,38 @@
|
|||||||
|
"use client"
|
||||||
|
|
||||||
import NextLink from "next/link"
|
import NextLink from "next/link"
|
||||||
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
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 Image from "@scandic-hotels/design-system/Image"
|
import Image from "@scandic-hotels/design-system/Image"
|
||||||
|
import { LocalCallCharges } from "@scandic-hotels/design-system/LocalCallCharges"
|
||||||
import { TextLink } from "@scandic-hotels/design-system/TextLink"
|
import { TextLink } from "@scandic-hotels/design-system/TextLink"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import LocalCallCharges from "@/components/LocalCallCharges"
|
import useLang from "../../../hooks/useLang"
|
||||||
import { getIntl } from "@/i18n"
|
|
||||||
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 { Hotel, HotelAddress } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
export default async function ContactInformation({
|
interface ContactInformationProps {
|
||||||
|
hotelAddress: HotelAddress
|
||||||
|
contact: Hotel["contactInformation"]
|
||||||
|
socials: Hotel["socialMedia"]
|
||||||
|
ecoLabels: Hotel["hotelFacts"]["ecoLabels"]
|
||||||
|
hotelName: Hotel["name"]
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ContactInformation({
|
||||||
hotelAddress,
|
hotelAddress,
|
||||||
contact,
|
contact,
|
||||||
socials,
|
socials,
|
||||||
ecoLabels,
|
ecoLabels,
|
||||||
hotelName,
|
hotelName,
|
||||||
}: ContactInformationProps) {
|
}: ContactInformationProps) {
|
||||||
const intl = await getIntl()
|
const intl = useIntl()
|
||||||
const lang = await getLang()
|
const lang = useLang()
|
||||||
const directionsUrl = `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(
|
const directionsUrl = `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(
|
||||||
`${hotelName}, ${hotelAddress.streetAddress}, ${hotelAddress.zipCode} ${hotelAddress.city}`
|
`${hotelName}, ${hotelAddress.streetAddress}, ${hotelAddress.zipCode} ${hotelAddress.city}`
|
||||||
)}`
|
)}`
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
.content {
|
.content {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--Space-x2);
|
gap: var(--Space-x4);
|
||||||
color: var(--Text-Default);
|
color: var(--Text-Default);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import { trackAccordionClick } from "@scandic-hotels/tracking/componentEvents"
|
|||||||
import { useBookingFlowConfig } from "../../../bookingFlowConfig/bookingFlowConfigContext"
|
import { useBookingFlowConfig } from "../../../bookingFlowConfig/bookingFlowConfigContext"
|
||||||
import { routeToScandicWebUrl } from "../../../utils/routeToScandicWebUrl"
|
import { routeToScandicWebUrl } from "../../../utils/routeToScandicWebUrl"
|
||||||
import AdditionalAmenities from "../../AdditionalAmenities"
|
import AdditionalAmenities from "../../AdditionalAmenities"
|
||||||
import Contact from "../../Contact"
|
|
||||||
import BreakfastAccordionItem from "../../SidePeekAccordions/BreakfastAccordionItem"
|
import BreakfastAccordionItem from "../../SidePeekAccordions/BreakfastAccordionItem"
|
||||||
import CheckInCheckOutAccordionItem from "../../SidePeekAccordions/CheckInCheckOutAccordionItem"
|
import CheckInCheckOutAccordionItem from "../../SidePeekAccordions/CheckInCheckOutAccordionItem"
|
||||||
import ParkingAccordionItem from "../../SidePeekAccordions/ParkingAccordionItem"
|
import ParkingAccordionItem from "../../SidePeekAccordions/ParkingAccordionItem"
|
||||||
|
import { ContactInformation } from "../ContactInformation"
|
||||||
|
|
||||||
import styles from "./hotelSidePeek.module.css"
|
import styles from "./hotelSidePeek.module.css"
|
||||||
|
|
||||||
@@ -41,15 +41,13 @@ export function HotelSidePeekContent({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
<Typography variant="Title/Subtitle/lg">
|
<ContactInformation
|
||||||
<h3>
|
hotelAddress={hotel.address}
|
||||||
{intl.formatMessage({
|
contact={hotel.contactInformation}
|
||||||
id: "common.practicalInformation",
|
socials={hotel.socialMedia}
|
||||||
defaultMessage: "Practical information",
|
ecoLabels={hotel.hotelFacts.ecoLabels}
|
||||||
})}
|
hotelName={hotel.name}
|
||||||
</h3>
|
/>
|
||||||
</Typography>
|
|
||||||
<Contact hotel={hotel} />
|
|
||||||
|
|
||||||
<Accordion type="sidepeek">
|
<Accordion type="sidepeek">
|
||||||
<ParkingAccordionItem
|
<ParkingAccordionItem
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
"./BookingWidget/BookingWidgetForm/FormContent/Search": "./lib/components/BookingWidget/BookingWidgetForm/FormContent/Search/index.tsx",
|
"./BookingWidget/BookingWidgetForm/FormContent/Search": "./lib/components/BookingWidget/BookingWidgetForm/FormContent/Search/index.tsx",
|
||||||
"./BookingWidget/FloatingBookingWidget": "./lib/components/BookingWidget/FloatingBookingWidget/index.tsx",
|
"./BookingWidget/FloatingBookingWidget": "./lib/components/BookingWidget/FloatingBookingWidget/index.tsx",
|
||||||
"./components/AdditionalAmenities": "./lib/components/AdditionalAmenities/index.tsx",
|
"./components/AdditionalAmenities": "./lib/components/AdditionalAmenities/index.tsx",
|
||||||
|
"./components/HotelDetails/ContactInformation": "./lib/components/HotelDetailsSidePeek/ContactInformation/index.tsx",
|
||||||
"./components/AddToCalendar": "./lib/components/AddToCalendar/index.tsx",
|
"./components/AddToCalendar": "./lib/components/AddToCalendar/index.tsx",
|
||||||
"./components/BookingConfirmation/Header/Actions/helpers": "./lib/components/BookingConfirmation/Header/Actions/helpers.ts",
|
"./components/BookingConfirmation/Header/Actions/helpers": "./lib/components/BookingConfirmation/Header/Actions/helpers.ts",
|
||||||
"./components/EnterDetails/enterDetailsErrors": "./lib/components/EnterDetails/enterDetailsErrors.ts",
|
"./components/EnterDetails/enterDetailsErrors": "./lib/components/EnterDetails/enterDetailsErrors.ts",
|
||||||
|
|||||||
8
packages/common/constants/country.ts
Normal file
8
packages/common/constants/country.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export enum Country {
|
||||||
|
Denmark = "Denmark",
|
||||||
|
Finland = "Finland",
|
||||||
|
Germany = "Germany",
|
||||||
|
Norway = "Norway",
|
||||||
|
Poland = "Poland",
|
||||||
|
Sweden = "Sweden",
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
"./constants/alert": "./constants/alert.ts",
|
"./constants/alert": "./constants/alert.ts",
|
||||||
"./constants/booking": "./constants/booking.ts",
|
"./constants/booking": "./constants/booking.ts",
|
||||||
"./constants/bookingWidget": "./constants/bookingWidget.ts",
|
"./constants/bookingWidget": "./constants/bookingWidget.ts",
|
||||||
|
"./constants/country": "./constants/country.ts",
|
||||||
"./constants/currency": "./constants/currency.ts",
|
"./constants/currency": "./constants/currency.ts",
|
||||||
"./constants/dateFormats": "./constants/dateFormats.ts",
|
"./constants/dateFormats": "./constants/dateFormats.ts",
|
||||||
"./constants/facilities": "./constants/facilities.ts",
|
"./constants/facilities": "./constants/facilities.ts",
|
||||||
|
|||||||
@@ -1,24 +1,26 @@
|
|||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
'use client'
|
||||||
import { Country } from "@scandic-hotels/trpc/types/country"
|
|
||||||
|
|
||||||
import { getIntl } from "@/i18n"
|
import { Country } from '@scandic-hotels/common/constants/country'
|
||||||
|
|
||||||
|
import { useIntl } from 'react-intl'
|
||||||
|
import { Typography } from '../Typography'
|
||||||
|
|
||||||
interface LocalCallChargesProps {
|
interface LocalCallChargesProps {
|
||||||
country: string
|
country: string
|
||||||
className?: string
|
className?: string
|
||||||
}
|
}
|
||||||
export default async function LocalCallCharges({
|
export function LocalCallCharges({
|
||||||
country,
|
country,
|
||||||
className,
|
className,
|
||||||
}: LocalCallChargesProps) {
|
}: LocalCallChargesProps) {
|
||||||
const intl = await getIntl()
|
const intl = useIntl()
|
||||||
|
|
||||||
return country === Country.Finland ? (
|
return country === Country.Finland ? (
|
||||||
<Typography variant="Body/Supporting text (caption)/smRegular">
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
<p className={className}>
|
<p className={className}>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
id: "common.localCallCharges",
|
id: 'common.localCallCharges',
|
||||||
defaultMessage: "Price: €0.16/min + local call charges",
|
defaultMessage: 'Price: €0.16/min + local call charges',
|
||||||
})}
|
})}
|
||||||
</p>
|
</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -141,6 +141,7 @@
|
|||||||
"./Lightbox": "./lib/components/Lightbox/index.tsx",
|
"./Lightbox": "./lib/components/Lightbox/index.tsx",
|
||||||
"./Link": "./lib/components/Link/index.tsx",
|
"./Link": "./lib/components/Link/index.tsx",
|
||||||
"./LoadingSpinner": "./lib/components/LoadingSpinner/index.tsx",
|
"./LoadingSpinner": "./lib/components/LoadingSpinner/index.tsx",
|
||||||
|
"./LocalCallCharges": "./lib/components/LocalCallCharges/index.tsx",
|
||||||
"./LoginButton": "./lib/components/LoginButton/index.tsx",
|
"./LoginButton": "./lib/components/LoginButton/index.tsx",
|
||||||
"./Map/InfoWindow": "./lib/components/Map/InfoWindow/index.tsx",
|
"./Map/InfoWindow": "./lib/components/Map/InfoWindow/index.tsx",
|
||||||
"./Map/InteractiveMap": "./lib/components/Map/InteractiveMap/index.tsx",
|
"./Map/InteractiveMap": "./lib/components/Map/InteractiveMap/index.tsx",
|
||||||
|
|||||||
@@ -10,13 +10,15 @@ import { safeProtectedServiceProcedure } from "../../procedures"
|
|||||||
import { getCityPageUrls } from "../../routers/contentstack/destinationCityPage/utils"
|
import { getCityPageUrls } from "../../routers/contentstack/destinationCityPage/utils"
|
||||||
import { getCountryPageUrls } from "../../routers/contentstack/destinationCountryPage/utils"
|
import { getCountryPageUrls } from "../../routers/contentstack/destinationCountryPage/utils"
|
||||||
import { getHotelPageUrls } from "../../routers/contentstack/hotelPage/utils"
|
import { getHotelPageUrls } from "../../routers/contentstack/hotelPage/utils"
|
||||||
import { ApiCountry, type Country } from "../../types/country"
|
import { ApiCountry } from "../../types/country"
|
||||||
import { getCitiesByCountry } from "../hotels/services/getCitiesByCountry"
|
import { getCitiesByCountry } from "../hotels/services/getCitiesByCountry"
|
||||||
import { getCountries } from "../hotels/services/getCountries"
|
import { getCountries } from "../hotels/services/getCountries"
|
||||||
import { getLocationsByCountries } from "../hotels/services/getLocationsByCountries"
|
import { getLocationsByCountries } from "../hotels/services/getLocationsByCountries"
|
||||||
import { filterAndCategorizeAutoComplete } from "./util/filterAndCategorizeAutoComplete"
|
import { filterAndCategorizeAutoComplete } from "./util/filterAndCategorizeAutoComplete"
|
||||||
import { mapLocationToAutoCompleteLocation } from "./util/mapLocationToAutoCompleteLocation"
|
import { mapLocationToAutoCompleteLocation } from "./util/mapLocationToAutoCompleteLocation"
|
||||||
|
|
||||||
|
import type { Country } from "@scandic-hotels/common/constants/country"
|
||||||
|
|
||||||
import type { AutoCompleteLocation } from "./schema"
|
import type { AutoCompleteLocation } from "./schema"
|
||||||
|
|
||||||
const destinationsAutoCompleteInputSchema = z.object({
|
const destinationsAutoCompleteInputSchema = z.object({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
|
|
||||||
import { Country } from "../../../types/country"
|
import { Country } from "@scandic-hotels/common/constants/country"
|
||||||
|
|
||||||
export const getCityPagesInput = z.object({
|
export const getCityPagesInput = z.object({
|
||||||
country: z.nativeEnum(Country),
|
country: z.nativeEnum(Country),
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
|
|
||||||
|
import { Country } from "@scandic-hotels/common/constants/country"
|
||||||
import { transformedImageVaultAssetSchema } from "@scandic-hotels/common/utils/imageVault"
|
import { transformedImageVaultAssetSchema } from "@scandic-hotels/common/utils/imageVault"
|
||||||
import { removeMultipleSlashes } from "@scandic-hotels/common/utils/url"
|
import { removeMultipleSlashes } from "@scandic-hotels/common/utils/url"
|
||||||
|
|
||||||
import { Country } from "../../../types/country"
|
|
||||||
import { DestinationCountryPageEnum } from "../../../types/destinationCountryPage"
|
import { DestinationCountryPageEnum } from "../../../types/destinationCountryPage"
|
||||||
import { discriminatedUnionArray } from "../../../utils/discriminatedUnion"
|
import { discriminatedUnionArray } from "../../../utils/discriminatedUnion"
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -3,13 +3,14 @@ import { createCounter } from "@scandic-hotels/common/telemetry"
|
|||||||
import { GetDestinationCityListData } from "../../../graphql/Query/DestinationCityPage/DestinationCityListData.graphql"
|
import { GetDestinationCityListData } from "../../../graphql/Query/DestinationCityPage/DestinationCityListData.graphql"
|
||||||
import { GetCountryPageUrls } from "../../../graphql/Query/DestinationCountryPage/DestinationCountryPageUrl.graphql"
|
import { GetCountryPageUrls } from "../../../graphql/Query/DestinationCountryPage/DestinationCountryPageUrl.graphql"
|
||||||
import { request } from "../../../graphql/request"
|
import { request } from "../../../graphql/request"
|
||||||
import { ApiCountry, type Country } from "../../../types/country"
|
import { ApiCountry } from "../../../types/country"
|
||||||
import { DestinationCountryPageEnum } from "../../../types/destinationCountryPage"
|
import { DestinationCountryPageEnum } from "../../../types/destinationCountryPage"
|
||||||
import { generateTag, generateTagsFromSystem } from "../../../utils/generateTag"
|
import { generateTag, generateTagsFromSystem } from "../../../utils/generateTag"
|
||||||
import { getCitiesByCountry } from "../../hotels/services/getCitiesByCountry"
|
import { getCitiesByCountry } from "../../hotels/services/getCitiesByCountry"
|
||||||
import { destinationCityListDataSchema } from "../destinationCityPage/output"
|
import { destinationCityListDataSchema } from "../destinationCityPage/output"
|
||||||
import { countryPageUrlsSchema } from "./output"
|
import { countryPageUrlsSchema } from "./output"
|
||||||
|
|
||||||
|
import type { Country } from "@scandic-hotels/common/constants/country"
|
||||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
|
|
||||||
import type { GetDestinationCityListDataResponse } from "../../../types/destinationCityPage"
|
import type { GetDestinationCityListDataResponse } from "../../../types/destinationCityPage"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
contentstackExtendedProcedureUID,
|
contentstackExtendedProcedureUID,
|
||||||
serviceProcedure,
|
serviceProcedure,
|
||||||
} from "../../../procedures"
|
} from "../../../procedures"
|
||||||
import { ApiCountry, type Country } from "../../../types/country"
|
import { ApiCountry } from "../../../types/country"
|
||||||
import {
|
import {
|
||||||
generateRefsResponseTag,
|
generateRefsResponseTag,
|
||||||
generateTag,
|
generateTag,
|
||||||
@@ -28,6 +28,8 @@ import {
|
|||||||
} from "./output"
|
} from "./output"
|
||||||
import { getSortedDestinationsByLanguage } from "./utils"
|
import { getSortedDestinationsByLanguage } from "./utils"
|
||||||
|
|
||||||
|
import type { Country } from "@scandic-hotels/common/constants/country"
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
GetDestinationOverviewPageData,
|
GetDestinationOverviewPageData,
|
||||||
GetDestinationOverviewPageRefsSchema,
|
GetDestinationOverviewPageRefsSchema,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
import { Country } from "@scandic-hotels/common/constants/country"
|
||||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
|
|
||||||
import { ApiCountry, Country } from "../../../types/country"
|
import { ApiCountry } from "../../../types/country"
|
||||||
|
|
||||||
import type { DestinationsData } from "../../../types/destinationsData"
|
import type { DestinationsData } from "../../../types/destinationsData"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
|
|
||||||
|
import { Country } from "@scandic-hotels/common/constants/country"
|
||||||
import {
|
import {
|
||||||
type FindMyBookingRoute,
|
type FindMyBookingRoute,
|
||||||
findMyBookingRoutes,
|
findMyBookingRoutes,
|
||||||
@@ -7,7 +8,6 @@ import {
|
|||||||
import { myStay } from "@scandic-hotels/common/constants/routes/myStay"
|
import { myStay } from "@scandic-hotels/common/constants/routes/myStay"
|
||||||
import { transformedImageVaultAssetSchema } from "@scandic-hotels/common/utils/imageVault"
|
import { transformedImageVaultAssetSchema } from "@scandic-hotels/common/utils/imageVault"
|
||||||
|
|
||||||
import { Country } from "../../../types/country"
|
|
||||||
import { RTETypeEnum } from "../../../types/RTEenums"
|
import { RTETypeEnum } from "../../../types/RTEenums"
|
||||||
import { destinationFilterSchema } from "../schemas/destinationFilters"
|
import { destinationFilterSchema } from "../schemas/destinationFilters"
|
||||||
import { systemSchema } from "../schemas/system"
|
import { systemSchema } from "../schemas/system"
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
|
|
||||||
|
import { Country } from "@scandic-hotels/common/constants/country"
|
||||||
|
|
||||||
import { BlocksEnums } from "../../../../types/blocksEnum"
|
import { BlocksEnums } from "../../../../types/blocksEnum"
|
||||||
import { Country } from "../../../../types/country"
|
|
||||||
|
|
||||||
export const locationFilterSchema = z
|
export const locationFilterSchema = z
|
||||||
.object({
|
.object({
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
|
|
||||||
|
import { Country } from "@scandic-hotels/common/constants/country"
|
||||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
|
|
||||||
import { BreakfastPackageEnum } from "../../enums/breakfast"
|
import { BreakfastPackageEnum } from "../../enums/breakfast"
|
||||||
import { ChildBedMapEnum } from "../../enums/childBedMapEnum"
|
import { ChildBedMapEnum } from "../../enums/childBedMapEnum"
|
||||||
import { RoomPackageCodeEnum } from "../../enums/roomFilter"
|
import { RoomPackageCodeEnum } from "../../enums/roomFilter"
|
||||||
import { Country } from "../../types/country"
|
|
||||||
|
|
||||||
const childrenInRoomSchema = z
|
const childrenInRoomSchema = z
|
||||||
.array(
|
.array(
|
||||||
|
|||||||
@@ -12,10 +12,9 @@ import { locationCitySchema } from "../schemas/location/city"
|
|||||||
import { locationHotelSchema } from "../schemas/location/hotel"
|
import { locationHotelSchema } from "../schemas/location/hotel"
|
||||||
import { getCity } from "./getCity"
|
import { getCity } from "./getCity"
|
||||||
|
|
||||||
|
import type { Country } from "@scandic-hotels/common/constants/country"
|
||||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
|
|
||||||
import type { Country } from "../../../types/country"
|
|
||||||
|
|
||||||
const hotelUtilsLogger = createLogger("getLocationsByCountries")
|
const hotelUtilsLogger = createLogger("getLocationsByCountries")
|
||||||
|
|
||||||
type CitiesNamesByCountry = Record<
|
type CitiesNamesByCountry = Record<
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
|
import { Country } from "@scandic-hotels/common/constants/country"
|
||||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
|
|
||||||
export enum Country {
|
|
||||||
Denmark = "Denmark",
|
|
||||||
Finland = "Finland",
|
|
||||||
Germany = "Germany",
|
|
||||||
Norway = "Norway",
|
|
||||||
Poland = "Poland",
|
|
||||||
Sweden = "Sweden",
|
|
||||||
}
|
|
||||||
|
|
||||||
export const ApiCountry: Record<Lang, Record<Country, string>> = {
|
export const ApiCountry: Record<Lang, Record<Country, string>> = {
|
||||||
[Lang.da]: {
|
[Lang.da]: {
|
||||||
[Country.Denmark]: "Danmark",
|
[Country.Denmark]: "Danmark",
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import type { Country } from "@scandic-hotels/common/constants/country"
|
||||||
import type { z } from "zod"
|
import type { z } from "zod"
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
@@ -5,7 +6,6 @@ import type {
|
|||||||
countriesSchema,
|
countriesSchema,
|
||||||
locationsSchema,
|
locationsSchema,
|
||||||
} from "../routers/hotels/output"
|
} from "../routers/hotels/output"
|
||||||
import type { Country } from "./country"
|
|
||||||
|
|
||||||
export interface LocationSchema extends z.output<typeof locationsSchema> {}
|
export interface LocationSchema extends z.output<typeof locationsSchema> {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user