Merged in fix/SW-2739-map-reward-night-not-enough-points (pull request #2435)

fix(SW-2739): remove tooltip and add correct CTA on map for reward nights

* fix(SW-2739): remove tooltip and add correct CTA on map for reward nights

* fix(SW-2739): fix pr comment


Approved-by: Arvid Norlin
This commit is contained in:
Bianca Widstam
2025-06-25 13:30:43 +00:00
parent 94fc5cabb3
commit 9e3d82b62c
7 changed files with 106 additions and 49 deletions

View File

@@ -54,11 +54,15 @@ export default function ListingHotelCardDialog({
redemptionPrice,
chequePrice,
voucherPrice,
hasEnoughPoints,
} = data
const firstImage = images[0]?.imageSizes?.small
const altText = images[0]?.metaData?.altText
const notEnoughPointsLabel = intl.formatMessage({
defaultMessage: "Not enough points",
})
return (
<div className={styles.container}>
<IconButton
@@ -212,17 +216,30 @@ export default function ListingHotelCardDialog({
)}
</div>
</div>
<Button asChild theme="base" size="small" className={styles.button}>
<Link
href={`${selectRate(lang)}?hotel=${operaId}`}
color="none"
keepSearchParams
{hasEnoughPoints ? (
<Button
asChild
theme="base"
size="small"
className={styles.button}
>
{intl.formatMessage({
defaultMessage: "See rooms",
})}
</Link>
</Button>
<Link
href={`${selectRate(lang)}?hotel=${operaId}`}
color="none"
keepSearchParams
>
{intl.formatMessage({
defaultMessage: "See rooms",
})}
</Link>
</Button>
) : (
<div className={styles.notEnoughPointsButton}>
<Typography variant="Body/Paragraph/mdBold">
<span>{notEnoughPointsLabel}</span>
</Typography>
</div>
)}
</div>
) : (
<NoPriceAvailableCard />

View File

@@ -74,3 +74,18 @@
top: 8px;
right: 8px;
}
.notEnoughPointsButton {
border-radius: var(--Corner-radius-rounded);
border-width: 2px;
border-style: solid;
display: flex;
align-items: center;
justify-content: center;
gap: var(--Space-x05);
padding: 10px var(--Space-x2);
background-color: var(--Component-Button-Brand-Primary-Fill-Disabled);
border-color: var(--Component-Button-Brand-Primary-Border-Disabled);
color: var(--Component-Button-Brand-Primary-On-fill-Disabled);
}

View File

@@ -5,6 +5,7 @@ import { useIntl } from "react-intl"
import { IconButton } from "@scandic-hotels/design-system/IconButton"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { selectRate } from "@/constants/routes/hotelReservation"
@@ -53,10 +54,14 @@ export default function StandaloneHotelCardDialog({
images,
ratings,
operaId,
hasEnoughPoints,
} = data
const firstImage = images[0]?.imageSizes?.small
const altText = images[0]?.metaData?.altText
const notEnoughPointsLabel = intl.formatMessage({
defaultMessage: "Not enough points",
})
return (
<div className={styles.container}>
@@ -224,33 +229,41 @@ export default function StandaloneHotelCardDialog({
<HotelPointsRow pointsPerStay={redemptionPrice} />
)}
</div>
<Button
asChild
theme="base"
size="small"
className={styles.button}
onClick={() =>
trackEvent({
event: "hotelClickMap",
map: {
action: "hotel click - map",
},
hotelInfo: {
hotelId: operaId,
},
})
}
>
<Link
href={`${selectRate(lang)}?hotel=${operaId}`}
color="none"
keepSearchParams
{hasEnoughPoints ? (
<Button
asChild
theme="base"
size="small"
className={styles.button}
onClick={() =>
trackEvent({
event: "hotelClickMap",
map: {
action: "hotel click - map",
},
hotelInfo: {
hotelId: operaId,
},
})
}
>
{intl.formatMessage({
defaultMessage: "See rooms",
})}
</Link>
</Button>
<Link
href={`${selectRate(lang)}?hotel=${operaId}`}
color="none"
keepSearchParams
>
{intl.formatMessage({
defaultMessage: "See rooms",
})}
</Link>
</Button>
) : (
<div className={styles.notEnoughPointsButton}>
<Typography variant="Body/Paragraph/mdBold">
<span>{notEnoughPointsLabel}</span>
</Typography>
</div>
)}
</>
) : (
<NoPriceAvailableCard />

View File

@@ -65,3 +65,18 @@
right: 8px;
z-index: 1;
}
.notEnoughPointsButton {
border-radius: var(--Corner-radius-rounded);
border-width: 2px;
border-style: solid;
display: flex;
align-items: center;
justify-content: center;
gap: var(--Space-x05);
padding: 10px var(--Space-x2);
background-color: var(--Component-Button-Brand-Primary-Fill-Disabled);
border-color: var(--Component-Button-Brand-Primary-Border-Disabled);
color: var(--Component-Button-Brand-Primary-On-fill-Disabled);
}