Merged in fix/SW-2739-reward-night-CTA-map (pull request #2446)

fix(SW-2739): only show not enough points if redemption

* fix(SW-2739): only show not enough points if redemption

* fix(SW-2739): rename variable


Approved-by: Arvid Norlin
This commit is contained in:
Bianca Widstam
2025-06-26 07:29:28 +00:00
parent 5ff86fca32
commit 0263ab8c87
2 changed files with 17 additions and 14 deletions

View File

@@ -62,6 +62,7 @@ export default function ListingHotelCardDialog({
const notEnoughPointsLabel = intl.formatMessage({
defaultMessage: "Not enough points",
})
const shouldShowNotEnoughPoints = redemptionPrice && !hasEnoughPoints
return (
<div className={styles.container}>
@@ -216,7 +217,13 @@ export default function ListingHotelCardDialog({
)}
</div>
</div>
{hasEnoughPoints ? (
{shouldShowNotEnoughPoints ? (
<div className={styles.notEnoughPointsButton}>
<Typography variant="Body/Paragraph/mdBold">
<span>{notEnoughPointsLabel}</span>
</Typography>
</div>
) : (
<Button
asChild
theme="base"
@@ -233,12 +240,6 @@ export default function ListingHotelCardDialog({
})}
</Link>
</Button>
) : (
<div className={styles.notEnoughPointsButton}>
<Typography variant="Body/Paragraph/mdBold">
<span>{notEnoughPointsLabel}</span>
</Typography>
</div>
)}
</div>
) : (

View File

@@ -63,6 +63,8 @@ export default function StandaloneHotelCardDialog({
defaultMessage: "Not enough points",
})
const shouldShowNotEnoughPoints = redemptionPrice && !hasEnoughPoints
return (
<div className={styles.container}>
<IconButton
@@ -229,7 +231,13 @@ export default function StandaloneHotelCardDialog({
<HotelPointsRow pointsPerStay={redemptionPrice} />
)}
</div>
{hasEnoughPoints ? (
{shouldShowNotEnoughPoints ? (
<div className={styles.notEnoughPointsButton}>
<Typography variant="Body/Paragraph/mdBold">
<span>{notEnoughPointsLabel}</span>
</Typography>
</div>
) : (
<Button
asChild
theme="base"
@@ -257,12 +265,6 @@ export default function StandaloneHotelCardDialog({
})}
</Link>
</Button>
) : (
<div className={styles.notEnoughPointsButton}>
<Typography variant="Body/Paragraph/mdBold">
<span>{notEnoughPointsLabel}</span>
</Typography>
</div>
)}
</>
) : (