feat(SW-706): make eslint rule 'formatjs/no-literal-string-in-jsx' pass

This commit is contained in:
Michael Zetterberg
2025-02-07 06:51:36 +01:00
parent e22fc1f3c8
commit 440e1f92df
393 changed files with 4839 additions and 1554 deletions

View File

@@ -93,11 +93,15 @@ export default function ListingHotelCardDialog({
<div className={styles.pricesContainer}>
{redemptionPrice ? (
<Caption color="uiTextHighContrast">
{intl.formatMessage({ id: "Available rates" })}
{intl.formatMessage({
defaultMessage: "Available rates",
})}
</Caption>
) : (
<Caption color="uiTextHighContrast">
{intl.formatMessage({ id: "Per night from" })}
{intl.formatMessage({
defaultMessage: "Per night from",
})}
</Caption>
)}
<div className={styles.listingPrices}>
@@ -106,13 +110,16 @@ export default function ListingHotelCardDialog({
<Subtitle type="two">
{publicPrice} {currency}
</Subtitle>
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
{memberPrice && <Caption>/</Caption>}
</>
)}
{memberPrice && (
<Subtitle type="two" color="red" className={styles.memberPrice}>
{intl.formatMessage(
{ id: "{price} {currency}" },
{
defaultMessage: "{price} {currency}",
},
{
price: memberPrice,
currency,
@@ -131,7 +138,9 @@ export default function ListingHotelCardDialog({
color="none"
keepSearchParams
>
{intl.formatMessage({ id: "See rooms" })}
{intl.formatMessage({
defaultMessage: "See rooms",
})}
</Link>
</Button>
</div>

View File

@@ -92,24 +92,36 @@ export default function StandaloneHotelCardDialog({
<div className={styles.priceCard}>
{redemptionPrice ? (
<Caption>
{intl.formatMessage({ id: "Available rates" })}
{intl.formatMessage({
defaultMessage: "Available rates",
})}
</Caption>
) : (
<Caption type="bold">
{intl.formatMessage({ id: "From" })}
{intl.formatMessage({
defaultMessage: "From",
})}
</Caption>
)}
{publicPrice && !isUserLoggedIn && (
<Subtitle type="two">
{intl.formatMessage(
{ id: "{price} {currency}" },
{
defaultMessage: "{price} {currency}",
},
{
price: publicPrice,
currency,
}
)}
<Body asChild>
<span>/{intl.formatMessage({ id: "night" })}</span>
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
<span>
/
{intl.formatMessage({
defaultMessage: "night",
})}
</span>
</Body>
</Subtitle>
)}
@@ -120,14 +132,22 @@ export default function StandaloneHotelCardDialog({
className={styles.memberPrice}
>
{intl.formatMessage(
{ id: "{price} {currency}" },
{
defaultMessage: "{price} {currency}",
},
{
price: memberPrice,
currency,
}
)}
<Body asChild color="red">
<span>/{intl.formatMessage({ id: "night" })}</span>
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
<span>
/
{intl.formatMessage({
defaultMessage: "night",
})}
</span>
</Body>
</Subtitle>
)}
@@ -146,7 +166,9 @@ export default function StandaloneHotelCardDialog({
color="none"
keepSearchParams
>
{intl.formatMessage({ id: "See rooms" })}
{intl.formatMessage({
defaultMessage: "See rooms",
})}
</Link>
</Button>
</>