feat(SW-706): make eslint rule 'formatjs/no-literal-string-in-jsx' pass
This commit is contained in:
@@ -20,7 +20,9 @@ export default async function ParkingPrices({
|
||||
|
||||
return freeParking ? (
|
||||
<Body textTransform="bold" color="uiTextHighContrast">
|
||||
{intl.formatMessage({ id: "Free parking" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Free parking",
|
||||
})}
|
||||
</Body>
|
||||
) : (
|
||||
<dl className={styles.wrapper}>
|
||||
@@ -34,7 +36,9 @@ export default async function ParkingPrices({
|
||||
<dd>
|
||||
{parking.amount
|
||||
? formatPrice(intl, parking.amount, currency)
|
||||
: intl.formatMessage({ id: "At a cost" })}
|
||||
: intl.formatMessage({
|
||||
defaultMessage: "At a cost",
|
||||
})}
|
||||
</dd>
|
||||
</Body>
|
||||
</div>
|
||||
@@ -43,9 +47,14 @@ export default async function ParkingPrices({
|
||||
parking.period !== Periods.allDay && (
|
||||
<div className={styles.information}>
|
||||
<Body color="uiTextHighContrast" asChild>
|
||||
<dt>{intl.formatMessage({ id: "From" })}</dt>
|
||||
<dt>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "From",
|
||||
})}
|
||||
</dt>
|
||||
</Body>
|
||||
<Body color="uiTextHighContrast" asChild>
|
||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||
<dd>{`${parking.startTime}-${parking.endTime}`}</dd>
|
||||
</Body>
|
||||
</div>
|
||||
|
||||
@@ -5,13 +5,21 @@ import { Periods } from "@/types/components/hotelPage/sidepeek/parking"
|
||||
export function getPeriod(intl: IntlShape, period?: string) {
|
||||
switch (period) {
|
||||
case Periods.hour:
|
||||
return intl.formatMessage({ id: "Price per hour" })
|
||||
return intl.formatMessage({
|
||||
defaultMessage: "Price per hour",
|
||||
})
|
||||
case Periods.day:
|
||||
return intl.formatMessage({ id: "Price per day" })
|
||||
return intl.formatMessage({
|
||||
defaultMessage: "Price per day",
|
||||
})
|
||||
case Periods.night:
|
||||
return intl.formatMessage({ id: "Price per night" })
|
||||
return intl.formatMessage({
|
||||
defaultMessage: "Price per night",
|
||||
})
|
||||
case Periods.allDay:
|
||||
return intl.formatMessage({ id: "Price per 24 hours" })
|
||||
return intl.formatMessage({
|
||||
defaultMessage: "Price per 24 hours",
|
||||
})
|
||||
default:
|
||||
return period
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user