Merged in fix/SW-3325-hotelcard-mobile-show-alert-left-align (pull request #2725)

fix(SW-3325): show alert in hotel card mobile and left align text

* fix(SW-3325): show alert in hotel card mobile and left align text


Approved-by: Joakim Jäderberg
This commit is contained in:
Bianca Widstam
2025-08-28 12:04:43 +00:00
parent 784c353b1e
commit 8a53e97e5f
4 changed files with 19 additions and 42 deletions

View File

@@ -1,11 +1,11 @@
.hotelDescription { .hotelDescription {
overflow: hidden; overflow: hidden;
text-align: left;
} }
.descriptionWrapper { .descriptionWrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center;
} }
.collapsed { .collapsed {
@@ -13,17 +13,19 @@
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
line-clamp: 2; line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
margin: var(--Space-x15) 0;
} }
.expanded { .expanded {
display: block; display: block;
max-height: none; max-height: none;
margin: var(--Space-x15) 0;
} }
.expandedContent { .expandedContent {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: flex-start;
margin-top: var(--Space-x2); margin-top: var(--Space-x2);
} }
@@ -34,7 +36,6 @@
.showMoreButton { .showMoreButton {
display: flex; display: flex;
align-items: flex-end;
background-color: transparent; background-color: transparent;
border-width: 0; border-width: 0;
padding: 0; padding: 0;
@@ -55,11 +56,9 @@
.facilityList { .facilityList {
display: flex; display: flex;
align-items: flex-start;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
gap: var(--Space-x15); gap: var(--Space-x15);
padding-bottom: var(--Space-x2);
} }
.facilitiesItem { .facilitiesItem {

View File

@@ -4,7 +4,6 @@ import { useState } from "react"
import { Button as ButtonRAC } from "react-aria-components" import { Button as ButtonRAC } from "react-aria-components"
import { useIntl } from "react-intl" import { useIntl } from "react-intl"
import { Alert } from "@scandic-hotels/design-system/Alert"
import { FacilityToIcon } from "@scandic-hotels/design-system/FacilityToIcon" import { FacilityToIcon } from "@scandic-hotels/design-system/FacilityToIcon"
import { Typography } from "@scandic-hotels/design-system/Typography" import { Typography } from "@scandic-hotels/design-system/Typography"
@@ -84,15 +83,8 @@ export default function HotelDescription({
defaultMessage: "See all amenities", defaultMessage: "See all amenities",
})} })}
buttonVariant="primary" buttonVariant="primary"
wrapping={false}
/> />
{hotel.specialAlerts.map((alert) => (
<Alert
key={alert.id}
type={alert.type}
heading={alert.heading}
text={alert.text}
/>
))}
</div> </div>
)} )}
</div> </div>

View File

@@ -45,17 +45,19 @@
.hotelAddressDescription { .hotelAddressDescription {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: var(--Space-x2); gap: var(--Space-x15);
align-items: center; align-items: center;
text-align: center; text-align: center;
} }
.hotelAlert { .facilities {
display: none; display: none;
} }
.facilities { .hotelAlert {
display: none; max-width: var(--max-width-page);
margin: 0 auto;
padding-top: var(--Space-x15);
} }
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
@@ -72,13 +74,6 @@
display: block; display: block;
} }
.hotelAlert {
display: block;
max-width: var(--max-width-page);
margin: 0 auto;
padding-top: var(--Space-x15);
}
.facilities { .facilities {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -89,11 +84,11 @@
.facilityList { .facilityList {
display: flex; display: flex;
flex-direction: column;
align-items: flex-start; align-items: flex-start;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
gap: var(--Space-x15); gap: var(--Space-x1);
padding-bottom: var(--Space-x1);
} }
.facilitiesItem { .facilitiesItem {
@@ -107,8 +102,8 @@
} }
.hotelContent { .hotelContent {
flex-direction: row;
gap: var(--Space-x6); gap: var(--Space-x6);
align-items: normal;
} }
.hotelInformation { .hotelInformation {
@@ -121,6 +116,7 @@
.hotelAddressDescription { .hotelAddressDescription {
align-items: normal; align-items: normal;
text-align: left; text-align: left;
gap: var(--Space-x2);
} }
.wrapper { .wrapper {
@@ -128,22 +124,10 @@
flex-direction: row; flex-direction: row;
} }
.facilities {
padding: var(--Space-x3) var(--Space-x3) var(--Space-x05);
}
.facilityList {
gap: var(--Space-x1);
padding-bottom: var(--Space-x05);
flex-direction: column;
}
.facilityTitle { .facilityTitle {
display: none; display: none;
} }
.hotelContent {
flex-direction: row;
align-items: center;
}
.imageWrapper { .imageWrapper {
align-self: center; align-self: center;
} }

View File

@@ -24,6 +24,7 @@ interface HotelDetailsSidePeekProps {
additionalHotelData: AdditionalData | undefined additionalHotelData: AdditionalData | undefined
triggerLabel: string triggerLabel: string
buttonVariant: "primary" | "secondary" buttonVariant: "primary" | "secondary"
wrapping?: boolean
} }
const buttonPropsMap: Record< const buttonPropsMap: Record<
@@ -52,6 +53,7 @@ export default function HotelDetailsSidePeek({
restaurants, restaurants,
additionalHotelData, additionalHotelData,
triggerLabel, triggerLabel,
wrapping = true,
buttonVariant, buttonVariant,
}: HotelDetailsSidePeekProps) { }: HotelDetailsSidePeekProps) {
const buttonProps = buttonPropsMap[buttonVariant] const buttonProps = buttonPropsMap[buttonVariant]
@@ -60,7 +62,7 @@ export default function HotelDetailsSidePeek({
<DialogTrigger> <DialogTrigger>
<Button <Button
{...buttonProps} {...buttonProps}
wrapping wrapping={wrapping}
onPress={() => onPress={() =>
trackOpenSidePeekEvent({ trackOpenSidePeekEvent({
name: SidePeekEnum.hotelDetails, name: SidePeekEnum.hotelDetails,