fix: hide address and decrease title size on smaller devices * fix(SW-2791): hide address and decrease title size on smaller devices Approved-by: Tobias Johansson
68 lines
2.1 KiB
TypeScript
68 lines
2.1 KiB
TypeScript
import Image from "@/components/Image"
|
|
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
|
import Title from "@/components/TempDesignSystem/Text/Title"
|
|
import { getIntl } from "@/i18n"
|
|
import { getSingleDecimal } from "@/utils/numberFormatting"
|
|
|
|
import ToggleSidePeek from "./ToggleSidePeek"
|
|
|
|
import styles from "./header.module.css"
|
|
|
|
import type { HotelHeaderProps } from "@/types/components/hotelReservation/enterDetails/hotelHeader"
|
|
|
|
export default async function HotelHeader({
|
|
hotelData: { hotel },
|
|
}: HotelHeaderProps) {
|
|
const intl = await getIntl()
|
|
const image = hotel.hotelContent?.images
|
|
|
|
const addressStr = `${hotel.address.streetAddress}, ${hotel.address.city}`
|
|
|
|
return (
|
|
<header className={styles.header}>
|
|
<Image
|
|
className={styles.hero}
|
|
alt={image.metaData.altText || image.metaData.altText_En || ""}
|
|
src={image.imageSizes.large}
|
|
height={200}
|
|
width={1196}
|
|
/>
|
|
<div className={styles.wrapper}>
|
|
<div className={styles.container}>
|
|
<div className={styles.titleContainer}>
|
|
<Title as="h1" level="h1" color="white" className={styles.title}>
|
|
{hotel.name}
|
|
</Title>
|
|
<Title
|
|
as="h2"
|
|
level="h1"
|
|
color="white"
|
|
className={styles.mobileTitle}
|
|
>
|
|
{hotel.name}
|
|
</Title>
|
|
<div className={styles.address}>
|
|
<Caption color="white">{addressStr}</Caption>
|
|
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
|
<Caption color="white">∙</Caption>
|
|
<Caption color="white">
|
|
{intl.formatMessage(
|
|
{
|
|
defaultMessage: "{number} km to city center",
|
|
},
|
|
{
|
|
number: getSingleDecimal(
|
|
hotel.location.distanceToCentre / 1000
|
|
),
|
|
}
|
|
)}
|
|
</Caption>
|
|
</div>
|
|
</div>
|
|
<ToggleSidePeek hotelId={hotel.operaId} />
|
|
</div>
|
|
</div>
|
|
</header>
|
|
)
|
|
}
|