feat(SW-630) Added alerts to hotel cards

This commit is contained in:
Pontus Dreij
2024-11-15 14:06:33 +01:00
parent 51f8412e2b
commit 821f667d06
3 changed files with 26 additions and 24 deletions

View File

@@ -85,6 +85,12 @@
min-width: 160px;
}
.specialAlerts {
display: flex;
flex-direction: column;
gap: var(--Spacing-x1);
}
@media screen and (min-width: 1367px) {
.card.pageListing {
flex-direction: row;

View File

@@ -39,8 +39,6 @@ export default function HotelCard({
const { hotelData } = hotel
const { price } = hotel
console.log(hotelData)
const amenities = hotelData.detailedFacilities.slice(0, 5)
const classNames = hotelCardVariants({
@@ -138,11 +136,7 @@ export default function HotelCard({
{hotelData.specialAlerts.length > 0 && (
<div className={styles.specialAlerts}>
{hotelData.specialAlerts.map((alert) => (
<Alert
key={alert.id}
type={alert.type}
heading={alert.heading}
/>
<Alert key={alert.id} type={alert.type} text={alert.text} />
))}
</div>
)}

View File

@@ -44,23 +44,25 @@ export default function Alert({
<h2>{heading}</h2>
</Body>
) : null}
<Body className={styles.text}>
{text}
{phoneContact?.phoneNumber ? (
<>
<span> {phoneContact.displayText} </span>
<Link
color="burgundy"
href={`tel:${phoneContact.phoneNumber.replace(/ /g, "")}`}
>
{phoneContact.phoneNumber}
</Link>
{phoneContact.footnote ? (
<span>. ({phoneContact.footnote})</span>
) : null}
</>
) : null}
</Body>
{text ? (
<Body className={styles.text}>
{text}
{phoneContact?.phoneNumber ? (
<>
<span> {phoneContact.displayText} </span>
<Link
color="burgundy"
href={`tel:${phoneContact.phoneNumber.replace(/ /g, "")}`}
>
{phoneContact.phoneNumber}
</Link>
{phoneContact.footnote ? (
<span>. ({phoneContact.footnote})</span>
) : null}
</>
) : null}
</Body>
) : null}
</div>
{link ? (
<Link color="burgundy" href={link.url}>