Merged in fix/SW-2629-hotelCard-new-design-mobile (pull request #2132)
fix(SW-2629): add new design for mobile * fix(SW-2629): add new design for mobile * fix(SW-2629): remove redundant brackets * fix(SW-2629): pr comments * fix(SW-2629): hydration error Approved-by: Christian Andolf
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import { FacilityToIcon } from "@/components/ContentType/HotelPage/data"
|
||||
import ImageGallery from "@/components/ImageGallery"
|
||||
import SkeletonShimmer from "@/components/SkeletonShimmer"
|
||||
import Alert from "@/components/TempDesignSystem/Alert"
|
||||
import Divider from "@/components/TempDesignSystem/Divider"
|
||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
import { getIntl } from "@/i18n"
|
||||
import { mapApiImagesToGalleryImages } from "@/utils/imageGallery"
|
||||
import { getSingleDecimal } from "@/utils/numberFormatting"
|
||||
|
||||
import ReadMore from "../../ReadMore"
|
||||
import TripAdvisorChip from "../../TripAdvisorChip"
|
||||
import HotelDescription from "./HotelDescription"
|
||||
|
||||
import styles from "./hotelInfoCard.module.css"
|
||||
|
||||
@@ -38,56 +38,56 @@ export default async function HotelInfoCard({ hotel }: HotelInfoCardProps) {
|
||||
</div>
|
||||
<div className={styles.hotelContent}>
|
||||
<div className={styles.hotelInformation}>
|
||||
<Title as="h2" textTransform="uppercase">
|
||||
{hotel.name}
|
||||
</Title>
|
||||
<Typography variant="Title/md">
|
||||
<h1 className={styles.hotelName}>{hotel.name}</h1>
|
||||
</Typography>
|
||||
<div className={styles.hotelAddressDescription}>
|
||||
<Caption color="uiTextMediumContrast">
|
||||
{intl.formatMessage(
|
||||
{
|
||||
defaultMessage:
|
||||
"{address}, {city} ∙ {distanceToCityCenterInKm} km to city center",
|
||||
},
|
||||
{
|
||||
address: hotel.address.streetAddress,
|
||||
city: hotel.address.city,
|
||||
distanceToCityCenterInKm: getSingleDecimal(
|
||||
hotel.location.distanceToCentre / 1000
|
||||
),
|
||||
}
|
||||
)}
|
||||
</Caption>
|
||||
<Body color="uiTextHighContrast">
|
||||
{hotel.hotelContent.texts.descriptions?.medium}
|
||||
</Body>
|
||||
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||
<p className={styles.hotelAddress}>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
defaultMessage:
|
||||
"{address}, {city} ∙ {distanceToCityCenterInKm} km to city center",
|
||||
},
|
||||
{
|
||||
address: hotel.address.streetAddress,
|
||||
city: hotel.address.city,
|
||||
distanceToCityCenterInKm: getSingleDecimal(
|
||||
hotel.location.distanceToCentre / 1000
|
||||
),
|
||||
}
|
||||
)}
|
||||
</p>
|
||||
</Typography>
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
<p className={styles.hotelDescription}>
|
||||
{hotel.hotelContent.texts.descriptions?.medium}
|
||||
</p>
|
||||
</Typography>
|
||||
<HotelDescription
|
||||
description={hotel.hotelContent.texts.descriptions?.medium}
|
||||
hotel={hotel}
|
||||
sortedFacilities={sortedFacilities}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Divider color="subtle" variant="vertical" />
|
||||
<div className={styles.facilities}>
|
||||
<div className={styles.facilityList}>
|
||||
<Body textTransform="bold" className={styles.facilityTitle}>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "At the hotel",
|
||||
})}
|
||||
</Body>
|
||||
{sortedFacilities?.map((facility) => {
|
||||
const Icon = (
|
||||
{sortedFacilities?.map((facility) => (
|
||||
<div className={styles.facilitiesItem} key={facility.id}>
|
||||
<FacilityToIcon id={facility.id} color="Icon/Default" />
|
||||
)
|
||||
return (
|
||||
<div className={styles.facilitiesItem} key={facility.id}>
|
||||
{Icon && Icon}
|
||||
<Body color="uiTextHighContrast">{facility.name}</Body>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||
<p>{facility.name}</p>
|
||||
</Typography>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<ReadMore
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "See all amenities",
|
||||
})}
|
||||
hotelId={hotel.operaId}
|
||||
hotel={hotel}
|
||||
showCTA={false}
|
||||
sidePeekKey={SidePeekEnum.amenities}
|
||||
/>
|
||||
@@ -113,38 +113,43 @@ export function HotelInfoCardSkeleton() {
|
||||
<article className={styles.container}>
|
||||
<section className={styles.wrapper}>
|
||||
<div className={styles.imageWrapper}>
|
||||
<SkeletonShimmer height={"100%"} width={"100%"} />
|
||||
<SkeletonShimmer height="100%" width="100%" />
|
||||
</div>
|
||||
<div className={styles.hotelContent}>
|
||||
<div className={styles.hotelInformation}>
|
||||
<SkeletonShimmer width={"60ch"} height={"40px"} />
|
||||
<SkeletonShimmer width="60ch" height="40px" />
|
||||
<div className={styles.hotelAddressDescription}>
|
||||
<Caption color="uiTextMediumContrast">
|
||||
<SkeletonShimmer width={"40ch"} />
|
||||
</Caption>
|
||||
<Body color="uiTextHighContrast">
|
||||
<SkeletonShimmer width={"60ch"} />
|
||||
<SkeletonShimmer width={"58ch"} />
|
||||
<SkeletonShimmer width={"45ch"} />
|
||||
</Body>
|
||||
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||
<SkeletonShimmer width="40ch" />
|
||||
</Typography>
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
<p>
|
||||
<SkeletonShimmer width="60ch" />
|
||||
<SkeletonShimmer width="58ch" />
|
||||
<SkeletonShimmer width="45ch" />
|
||||
</p>
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
<Divider color="subtle" variant="vertical" />
|
||||
<div className={styles.facilities}>
|
||||
<div className={styles.facilityList}>
|
||||
<Body textTransform="bold" className={styles.facilityTitle}>
|
||||
<SkeletonShimmer width={"20ch"} />
|
||||
</Body>
|
||||
<Typography
|
||||
variant="Body/Paragraph/mdBold"
|
||||
className={styles.facilityTitle}
|
||||
>
|
||||
<SkeletonShimmer width="20ch" />
|
||||
</Typography>
|
||||
{[1, 2, 3, 4, 5]?.map((id) => {
|
||||
return (
|
||||
<div className={styles.facilitiesItem} key={id}>
|
||||
<SkeletonShimmer width={"10ch"} />
|
||||
<SkeletonShimmer width="10ch" />
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
<div className={styles.hotelAlert}>
|
||||
<SkeletonShimmer width={"18ch"} />
|
||||
<SkeletonShimmer width="18ch" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user