feat(SW-706): make eslint rule 'formatjs/no-literal-string-in-jsx' pass
This commit is contained in:
@@ -23,15 +23,21 @@ export default function BookingCodeFilter() {
|
||||
|
||||
const bookingCodeFilterItems = [
|
||||
{
|
||||
label: intl.formatMessage({ id: "Discounted rooms" }),
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "Discounted rooms",
|
||||
}),
|
||||
value: BookingCodeFilterEnum.Discounted,
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({ id: "Full price rooms" }),
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "Full price rooms",
|
||||
}),
|
||||
value: BookingCodeFilterEnum.Regular,
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({ id: "See all" }),
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "See all",
|
||||
}),
|
||||
value: BookingCodeFilterEnum.All,
|
||||
},
|
||||
]
|
||||
@@ -44,7 +50,9 @@ export default function BookingCodeFilter() {
|
||||
<>
|
||||
<div className={styles.bookingCodeFilter}>
|
||||
<Select
|
||||
aria-label={intl.formatMessage({ id: "Booking Code Filter" })}
|
||||
aria-label={intl.formatMessage({
|
||||
defaultMessage: "Booking Code Filter",
|
||||
})}
|
||||
className={styles.bookingCodeFilterSelect}
|
||||
name="bookingCodeFilter"
|
||||
onSelect={updateFilter}
|
||||
|
||||
@@ -50,13 +50,27 @@ export default function FilterAndSortModal({
|
||||
|
||||
const sortItems: SortItem[] = [
|
||||
{
|
||||
label: intl.formatMessage({ id: "Distance to city center" }),
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "Distance to city center",
|
||||
}),
|
||||
value: SortOrder.Distance,
|
||||
},
|
||||
{ label: intl.formatMessage({ id: "Name" }), value: SortOrder.Name },
|
||||
{ label: intl.formatMessage({ id: "Price" }), value: SortOrder.Price },
|
||||
{
|
||||
label: intl.formatMessage({ id: "TripAdvisor rating" }),
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "Name",
|
||||
}),
|
||||
value: SortOrder.Name,
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "Price",
|
||||
}),
|
||||
value: SortOrder.Price,
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "TripAdvisor rating",
|
||||
}),
|
||||
value: SortOrder.TripAdvisorRating,
|
||||
},
|
||||
]
|
||||
@@ -97,7 +111,9 @@ export default function FilterAndSortModal({
|
||||
<DialogTrigger>
|
||||
<Button intent="secondary" size="small" theme="base" variant="icon">
|
||||
<MaterialIcon icon="filter_alt" color="Icon/Intense" />
|
||||
{intl.formatMessage({ id: "Filter and sort" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Filter and sort",
|
||||
})}
|
||||
{activeFilters.length > 0 && (
|
||||
<Footnote className={styles.badge}>{activeFilters.length}</Footnote>
|
||||
)}
|
||||
@@ -120,7 +136,9 @@ export default function FilterAndSortModal({
|
||||
textAlign="center"
|
||||
className={styles.title}
|
||||
>
|
||||
{intl.formatMessage({ id: "Filter and sort" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Filter and sort",
|
||||
})}
|
||||
</Subtitle>
|
||||
</header>
|
||||
<div className={styles.sorter}>
|
||||
@@ -129,7 +147,9 @@ export default function FilterAndSortModal({
|
||||
defaultSelectedKey={
|
||||
searchParams.get("sort") ?? DEFAULT_SORT
|
||||
}
|
||||
label={intl.formatMessage({ id: "Sort by" })}
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Sort by",
|
||||
})}
|
||||
name="sort"
|
||||
showRadioButton
|
||||
onSelect={handleSortSelect}
|
||||
@@ -149,7 +169,9 @@ export default function FilterAndSortModal({
|
||||
onClick={() => handleApplyFiltersAndSorting(close)}
|
||||
>
|
||||
{intl.formatMessage(
|
||||
{ id: "See results ({ count })" },
|
||||
{
|
||||
defaultMessage: "See results ({ count })",
|
||||
},
|
||||
{
|
||||
count: resultCount,
|
||||
}
|
||||
@@ -161,7 +183,9 @@ export default function FilterAndSortModal({
|
||||
size="medium"
|
||||
theme="base"
|
||||
>
|
||||
{intl.formatMessage({ id: "Clear all filters" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Clear all filters",
|
||||
})}
|
||||
</Button>
|
||||
</footer>
|
||||
</>
|
||||
|
||||
@@ -14,7 +14,7 @@ export default function HotelCount() {
|
||||
<Preamble>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
id: "{amount, plural, one {# hotel} other {# hotels}}",
|
||||
defaultMessage: "{amount, plural, one {# hotel} other {# hotels}}",
|
||||
},
|
||||
{ amount: resultCount }
|
||||
)}
|
||||
|
||||
@@ -52,9 +52,17 @@ export default function HotelFilter({ className, filters }: HotelFiltersProps) {
|
||||
return (
|
||||
<aside className={`${styles.container} ${className}`}>
|
||||
<form>
|
||||
<Title as="h4">{intl.formatMessage({ id: "Filter by" })}</Title>
|
||||
<Title as="h4">
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Filter by",
|
||||
})}
|
||||
</Title>
|
||||
<div className={styles.facilities}>
|
||||
<Subtitle>{intl.formatMessage({ id: "Hotel facilities" })}</Subtitle>
|
||||
<Subtitle>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Hotel facilities",
|
||||
})}
|
||||
</Subtitle>
|
||||
<ul>
|
||||
{filters.facilityFilters.map((filter) => (
|
||||
<li key={`li-${filter.id}`} className={styles.filter}>
|
||||
@@ -73,7 +81,9 @@ export default function HotelFilter({ className, filters }: HotelFiltersProps) {
|
||||
|
||||
<div className={styles.facilities}>
|
||||
<Subtitle>
|
||||
{intl.formatMessage({ id: "Hotel surroundings" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Hotel surroundings",
|
||||
})}
|
||||
</Subtitle>
|
||||
<ul>
|
||||
{filters.surroundingsFilters.map((filter) => (
|
||||
|
||||
@@ -39,13 +39,27 @@ export default function HotelSorter({ discreet }: HotelSorterProps) {
|
||||
)
|
||||
const sortItems: SortItem[] = [
|
||||
{
|
||||
label: intl.formatMessage({ id: "Distance to city center" }),
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "Distance to city center",
|
||||
}),
|
||||
value: SortOrder.Distance,
|
||||
},
|
||||
{ label: intl.formatMessage({ id: "Name" }), value: SortOrder.Name },
|
||||
{ label: intl.formatMessage({ id: "Price" }), value: SortOrder.Price },
|
||||
{
|
||||
label: intl.formatMessage({ id: "TripAdvisor rating" }),
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "Name",
|
||||
}),
|
||||
value: SortOrder.Name,
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "Price",
|
||||
}),
|
||||
value: SortOrder.Price,
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "TripAdvisor rating",
|
||||
}),
|
||||
value: SortOrder.TripAdvisorRating,
|
||||
},
|
||||
]
|
||||
@@ -54,8 +68,12 @@ export default function HotelSorter({ discreet }: HotelSorterProps) {
|
||||
<Select
|
||||
items={sortItems}
|
||||
defaultSelectedKey={searchParams.get("sort") ?? DEFAULT_SORT}
|
||||
label={intl.formatMessage({ id: "Sort by" })}
|
||||
aria-label={intl.formatMessage({ id: "Sort by" })}
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Sort by",
|
||||
})}
|
||||
aria-label={intl.formatMessage({
|
||||
defaultMessage: "Sort by",
|
||||
})}
|
||||
name="sort"
|
||||
showRadioButton
|
||||
discreet={discreet}
|
||||
|
||||
@@ -47,7 +47,9 @@ export default function MobileMapButtonContainer({
|
||||
weight="bold"
|
||||
>
|
||||
<MaterialIcon icon="map" color="Icon/Intense" />
|
||||
{intl.formatMessage({ id: "See on map" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "See on map",
|
||||
})}
|
||||
</Link>
|
||||
</Button>
|
||||
<FilterAndSortModal filters={filters} />
|
||||
|
||||
@@ -24,12 +24,17 @@ export default async function NoAvailabilityAlert({
|
||||
return (
|
||||
<Alert
|
||||
type={AlertTypeEnum.Info}
|
||||
heading={intl.formatMessage({ id: "No availability" })}
|
||||
heading={intl.formatMessage({
|
||||
defaultMessage: "No availability",
|
||||
})}
|
||||
text={intl.formatMessage({
|
||||
id: "Please try and change your search for this destination or see alternative hotels.",
|
||||
defaultMessage:
|
||||
"Please try and change your search for this destination or see alternative hotels.",
|
||||
})}
|
||||
link={{
|
||||
title: intl.formatMessage({ id: "See alternative hotels" }),
|
||||
title: intl.formatMessage({
|
||||
defaultMessage: "See alternative hotels",
|
||||
}),
|
||||
url: `${alternativeHotels(lang)}?hotel=${operaId}`,
|
||||
keepSearchParams: true,
|
||||
}}
|
||||
@@ -40,9 +45,11 @@ export default async function NoAvailabilityAlert({
|
||||
return (
|
||||
<Alert
|
||||
type={AlertTypeEnum.Info}
|
||||
heading={intl.formatMessage({ id: "No availability" })}
|
||||
heading={intl.formatMessage({
|
||||
defaultMessage: "No availability",
|
||||
})}
|
||||
text={intl.formatMessage({
|
||||
id: "There are no rooms available that match your request.",
|
||||
defaultMessage: "There are no rooms available that match your request.",
|
||||
})}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -136,7 +136,9 @@ export default function SelectHotelContent({
|
||||
>
|
||||
<Link href={selectHotel(lang)} keepSearchParams prefetch>
|
||||
<MaterialIcon icon="close" size={20} color="CurrentColor" />
|
||||
{intl.formatMessage({ id: "Close the map" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Close the map",
|
||||
})}
|
||||
</Link>
|
||||
</Button>
|
||||
)
|
||||
|
||||
@@ -86,23 +86,31 @@ export default async function SelectHotel({
|
||||
const convertedSearchParams = convertObjToSearchParams(selectHotelParams)
|
||||
const breadcrumbs = [
|
||||
{
|
||||
title: intl.formatMessage({ id: "Home" }),
|
||||
title: intl.formatMessage({
|
||||
defaultMessage: "Home",
|
||||
}),
|
||||
href: `/${params.lang}`,
|
||||
uid: "home-page",
|
||||
},
|
||||
{
|
||||
title: intl.formatMessage({ id: "Hotel reservation" }),
|
||||
title: intl.formatMessage({
|
||||
defaultMessage: "Hotel reservation",
|
||||
}),
|
||||
href: `/${params.lang}/hotelreservation`,
|
||||
uid: "hotel-reservation",
|
||||
},
|
||||
isAlternativeFor
|
||||
? {
|
||||
title: intl.formatMessage({ id: "Alternative hotels" }),
|
||||
title: intl.formatMessage({
|
||||
defaultMessage: "Alternative hotels",
|
||||
}),
|
||||
href: `${alternativeHotels(params.lang)}/?${convertedSearchParams}`,
|
||||
uid: "alternative-hotels",
|
||||
}
|
||||
: {
|
||||
title: intl.formatMessage({ id: "Select hotel" }),
|
||||
title: intl.formatMessage({
|
||||
defaultMessage: "Select hotel",
|
||||
}),
|
||||
href: `${selectHotel(params.lang)}/?${convertedSearchParams}`,
|
||||
uid: "select-hotel",
|
||||
},
|
||||
@@ -182,7 +190,9 @@ export default async function SelectHotel({
|
||||
<Subtitle>
|
||||
{isAlternativeFor
|
||||
? intl.formatMessage(
|
||||
{ id: "Alternatives for {value}" },
|
||||
{
|
||||
defaultMessage: "Alternatives for {value}",
|
||||
},
|
||||
{
|
||||
value: isAlternativeFor.name,
|
||||
}
|
||||
@@ -227,7 +237,9 @@ export default async function SelectHotel({
|
||||
altText={`Map of ${city.name} city center`}
|
||||
/>
|
||||
<Button wrapping size="medium" intent="text" theme="base">
|
||||
{intl.formatMessage({ id: "See map" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "See map",
|
||||
})}
|
||||
<MaterialIcon
|
||||
icon="chevron_right"
|
||||
size={20}
|
||||
|
||||
Reference in New Issue
Block a user