feat(SW-281): change requests

This commit is contained in:
Fredrik Thorsson
2024-10-25 13:28:46 +02:00
parent b113daf6c1
commit 720dc4c26b
3 changed files with 20 additions and 17 deletions

View File

@@ -7,6 +7,7 @@
.image { .image {
width: 100%; width: 100%;
max-height: 200px;
object-fit: cover; object-fit: cover;
} }
@@ -29,21 +30,20 @@
.captions { .captions {
display: flex; display: flex;
flex-direction: row;
} }
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
.container { .container {
display: grid; display: grid;
grid-template-columns: 1fr 2fr; grid-template-columns: minmax(250px, 350px) auto;
} }
.image { .image {
max-height: none;
height: 100%; height: 100%;
} }
.button { .button {
width: 100%; width: min(100%, 200px);
max-width: 200px;
} }
} }

View File

@@ -6,6 +6,7 @@ import Link from "@/components/TempDesignSystem/Link"
import Body from "@/components/TempDesignSystem/Text/Body" import Body from "@/components/TempDesignSystem/Text/Body"
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"
import Title from "@/components/TempDesignSystem/Text/Title"
import { getIntl } from "@/i18n" import { getIntl } from "@/i18n"
import styles from "./hotelListing.module.css" import styles from "./hotelListing.module.css"
@@ -13,30 +14,31 @@ import styles from "./hotelListing.module.css"
import type { HotelListingProps } from "@/types/components/contentPage/hotelListing" import type { HotelListingProps } from "@/types/components/contentPage/hotelListing"
export default async function HotelListing({ export default async function HotelListing({
image, imageUrl,
altText, altText,
name, name,
address, address,
distanceToCentre, distanceToCentre,
description, description,
link,
}: HotelListingProps) { }: HotelListingProps) {
const intl = await getIntl() const intl = await getIntl()
return ( return (
<article className={styles.container}> <article className={styles.container}>
<section>
<Image <Image
src={image} src={imageUrl}
alt={altText} alt={altText}
width={300} width={300}
height={200} height={200}
className={styles.image} className={styles.image}
/> />
</section>
<section className={styles.content}> <section className={styles.content}>
<div className={styles.intro}> <div className={styles.intro}>
<ScandicLogoIcon color="red" /> <ScandicLogoIcon color="red" />
<Subtitle>{name}</Subtitle> <Subtitle asChild>
<Title as="h3">{name}</Title>
</Subtitle>
<div className={styles.captions}> <div className={styles.captions}>
<Caption color="uiTextPlaceholder">{address}</Caption> <Caption color="uiTextPlaceholder">{address}</Caption>
<div className={styles.dividerContainer}> <div className={styles.dividerContainer}>
@@ -58,7 +60,7 @@ export default async function HotelListing({
className={styles.button} className={styles.button}
asChild asChild
> >
<Link href="#" color="white"> <Link href={link} color="white">
{intl.formatMessage({ id: "See hotel details" })} {intl.formatMessage({ id: "See hotel details" })}
</Link> </Link>
</Button> </Button>

View File

@@ -1,10 +1,11 @@
import type { Hotel } from "@/types/hotel" import type { Hotel } from "@/types/hotel"
export type HotelListingProps = { export type HotelListingProps = {
image: Hotel["hotelContent"]["images"]["imageSizes"]["large"] imageUrl: Hotel["hotelContent"]["images"]["imageSizes"]["large"]
altText: Hotel["hotelContent"]["images"]["metaData"]["altText"] altText: Hotel["hotelContent"]["images"]["metaData"]["altText"]
name: Hotel["name"] name: Hotel["name"]
address: Hotel["address"]["streetAddress"] address: Hotel["address"]["streetAddress"]
distanceToCentre: Hotel["location"]["distanceToCentre"] distanceToCentre: Hotel["location"]["distanceToCentre"]
description: Hotel["hotelContent"]["texts"]["descriptions"]["medium"] description: Hotel["hotelContent"]["texts"]["descriptions"]["medium"]
link: string
} }