From 8c4ade719f171b8be5bc1492558a5fdea55f198f Mon Sep 17 00:00:00 2001 From: Fredrik Thorsson Date: Tue, 27 Aug 2024 09:38:01 +0200 Subject: [PATCH] feat(SW-252): wrap image for layout --- .../HotelCard/hotelCard.module.css | 36 ++++++++++----- .../HotelReservation/HotelCard/index.tsx | 46 +++++++++++++------ .../TempDesignSystem/Chip/chip.module.css | 8 ---- components/TempDesignSystem/Chip/variants.ts | 2 - 4 files changed, 55 insertions(+), 37 deletions(-) diff --git a/components/HotelReservation/HotelCard/hotelCard.module.css b/components/HotelReservation/HotelCard/hotelCard.module.css index 72f6d2877..159207d78 100644 --- a/components/HotelReservation/HotelCard/hotelCard.module.css +++ b/components/HotelReservation/HotelCard/hotelCard.module.css @@ -12,26 +12,27 @@ width: 307px; } -.header { - grid-area: header; +.imageContainer { + grid-area: image; +} + +.tripAdvisor { + display: none; } .image { height: 100%; - max-height: 95px; width: 116px; object-fit: cover; - grid-area: image; } -.logo { - margin-bottom: var(--Spacing-x-half); +.header { + grid-area: header; } .hotel { display: flex; flex-direction: column; - gap: var(--Spacing-x1); grid-area: hotel; } @@ -49,7 +50,7 @@ .link { display: flex; - padding: var(--Spacing-x1) var(--Spacing-x0); + padding: var(--Spacing-x2) var(--Spacing-x0); border-bottom: 1px solid var(--Base-Border-Subtle); } @@ -67,7 +68,7 @@ } .button { - display: none; + justify-content: center; } @media screen and (min-width: 1367px) { @@ -81,8 +82,18 @@ padding: 0; } + .imageContainer { + position: relative; + } + + .tripAdvisor { + display: block; + position: absolute; + left: 7px; + top: 7px; + } + .image { - max-height: 100%; width: 518px; } @@ -92,11 +103,14 @@ } .hotel { + gap: var(--Spacing-x2); padding-right: var(--Spacing-x2); } .prices { flex-direction: row; + align-items: center; + justify-content: space-between; padding-right: var(--Spacing-x2); padding-bottom: var(--Spacing-x2); } @@ -106,8 +120,6 @@ } .button { - display: flex; width: 160px; - justify-content: center; } } diff --git a/components/HotelReservation/HotelCard/index.tsx b/components/HotelReservation/HotelCard/index.tsx index 7ef9b14a3..c4721abb5 100644 --- a/components/HotelReservation/HotelCard/index.tsx +++ b/components/HotelReservation/HotelCard/index.tsx @@ -4,6 +4,7 @@ import { PriceTagIcon, ScandicLogoIcon, } from "@/components/Icons" +import TripAdvisorIcon from "@/components/Icons/TripAdvisor" import Image from "@/components/Image" import Button from "@/components/TempDesignSystem/Button" import Chip from "@/components/TempDesignSystem/Chip" @@ -26,20 +27,32 @@ export default async function HotelCard({ hotel }: HotelCardProps) { return (
- {hotel.hotelContent.images.metaData.altText} +
+ {hotel.hotelContent.images.metaData.altText} +
+ + + {hotel.ratings?.tripAdvisor.rating} + +
+
- + {hotel.name} - {`${hotel.address.streetAddress}, ${hotel.address.city}`} - {`${hotel.location.distanceToCentre} ${intl.formatMessage({ id: "km to city center" })}`} + + {`${hotel.address.streetAddress}, ${hotel.address.city}`} + + + {`${hotel.location.distanceToCentre} ${intl.formatMessage({ id: "km to city center" })}`} +
@@ -60,28 +73,31 @@ export default async function HotelCard({ hotel }: HotelCardProps) {
- - + + {intl.formatMessage({ id: "Public price from" })} 2820 SEK / night approx 280 eur
- - + + {intl.formatMessage({ id: "Member price from" })} 2820 SEK / night approx 280 eur
diff --git a/components/TempDesignSystem/Chip/chip.module.css b/components/TempDesignSystem/Chip/chip.module.css index 5f3ac60d4..dbfb0e98b 100644 --- a/components/TempDesignSystem/Chip/chip.module.css +++ b/components/TempDesignSystem/Chip/chip.module.css @@ -12,11 +12,3 @@ div.chip { background-color: var(--Scandic-Red-90); color: var(--Primary-Dark-On-Surface-Accent); } - -.subtle { - background-color: var(--Base-Surface-Subtle-Normal); -} - -.pale { - background-color: var(--Scandic-Brand-Pale-Peach); -} diff --git a/components/TempDesignSystem/Chip/variants.ts b/components/TempDesignSystem/Chip/variants.ts index 420f61ec3..a17e6d98d 100644 --- a/components/TempDesignSystem/Chip/variants.ts +++ b/components/TempDesignSystem/Chip/variants.ts @@ -6,8 +6,6 @@ export const chipVariants = cva(styles.chip, { variants: { intent: { primary: styles.primary, - sublte: styles.subtle, - pale: styles.pale, }, variant: { default: styles.default,