feat(SW-706): make eslint rule 'formatjs/no-literal-string-in-jsx' pass
This commit is contained in:
@@ -15,10 +15,10 @@ export default async function ParkingList({
|
||||
const intl = await getIntl()
|
||||
|
||||
const canMakeReservationYesMsg = intl.formatMessage({
|
||||
id: "Parking can be reserved in advance: Yes",
|
||||
defaultMessage: "Parking can be reserved in advance: Yes",
|
||||
})
|
||||
const canMakeReservationNoMsg = intl.formatMessage({
|
||||
id: "Parking can be reserved in advance: No",
|
||||
defaultMessage: "Parking can be reserved in advance: No",
|
||||
})
|
||||
|
||||
return (
|
||||
@@ -27,7 +27,10 @@ export default async function ParkingList({
|
||||
{numberOfChargingSpaces ? (
|
||||
<li>
|
||||
{intl.formatMessage(
|
||||
{ id: "Number of charging points for electric cars: {number}" },
|
||||
{
|
||||
defaultMessage:
|
||||
"Number of charging points for electric cars: {number}",
|
||||
},
|
||||
{ number: numberOfChargingSpaces }
|
||||
)}
|
||||
</li>
|
||||
@@ -40,7 +43,9 @@ export default async function ParkingList({
|
||||
{numberOfParkingSpots ? (
|
||||
<li>
|
||||
{intl.formatMessage(
|
||||
{ id: "Number of parking spots: {number}" },
|
||||
{
|
||||
defaultMessage: "Number of parking spots: {number}",
|
||||
},
|
||||
{ number: numberOfParkingSpots }
|
||||
)}
|
||||
</li>
|
||||
@@ -48,14 +53,21 @@ export default async function ParkingList({
|
||||
{distanceToHotel ? (
|
||||
<li>
|
||||
{intl.formatMessage(
|
||||
{ id: "Distance to hotel: {distanceInM} m" },
|
||||
{
|
||||
defaultMessage: "Distance to hotel: {distanceInM} m",
|
||||
},
|
||||
{ distanceInM: distanceToHotel }
|
||||
)}
|
||||
</li>
|
||||
) : null}
|
||||
{address ? (
|
||||
<li>
|
||||
{intl.formatMessage({ id: "Address: {address}" }, { address })}
|
||||
{intl.formatMessage(
|
||||
{
|
||||
defaultMessage: "Address: {address}",
|
||||
},
|
||||
{ address }
|
||||
)}
|
||||
</li>
|
||||
) : null}
|
||||
</ul>
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -41,11 +41,17 @@ export default async function ParkingInformation({
|
||||
</div>
|
||||
<div className={styles.prices}>
|
||||
<Subtitle type="two" asChild>
|
||||
<h5>{intl.formatMessage({ id: "Prices" })}</h5>
|
||||
<h5>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Prices",
|
||||
})}
|
||||
</h5>
|
||||
</Subtitle>
|
||||
<div className={styles.priceWrapper}>
|
||||
<Caption color="uiTextMediumContrast" textTransform="uppercase">
|
||||
{intl.formatMessage({ id: "Weekday prices" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Weekday prices",
|
||||
})}
|
||||
</Caption>
|
||||
<Divider color="baseSurfaceSubtleHover" />
|
||||
{parking.pricing.localCurrency ? (
|
||||
@@ -58,7 +64,9 @@ export default async function ParkingInformation({
|
||||
</div>
|
||||
<div className={styles.priceWrapper}>
|
||||
<Caption color="uiTextMediumContrast" textTransform="uppercase">
|
||||
{intl.formatMessage({ id: "Weekend prices" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Weekend prices",
|
||||
})}
|
||||
</Caption>
|
||||
<Divider color="baseSurfaceSubtleHover" />
|
||||
{parking.pricing.localCurrency ? (
|
||||
@@ -73,7 +81,9 @@ export default async function ParkingInformation({
|
||||
{parking.externalParkingUrl && showExternalParkingButton && (
|
||||
<Button theme="base" intent="primary" variant="icon" asChild>
|
||||
<Link href={parking.externalParkingUrl} target="_blank">
|
||||
{intl.formatMessage({ id: "Book parking" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Book parking",
|
||||
})}
|
||||
<MaterialIcon icon="open_in_new" color="CurrentColor" />
|
||||
</Link>
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user