feat(SW-706): make eslint rule 'formatjs/no-literal-string-in-jsx' pass
This commit is contained in:
@@ -35,7 +35,11 @@ export default function ClearSearchButton({
|
||||
>
|
||||
<MaterialIcon icon="delete" color="Icon/Interactive/Default" size={20} />
|
||||
<Caption color="burgundy" type="bold" asChild>
|
||||
<span>{intl.formatMessage({ id: "Clear searches" })}</span>
|
||||
<span>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Clear searches",
|
||||
})}
|
||||
</span>
|
||||
</Caption>
|
||||
</button>
|
||||
)
|
||||
|
||||
@@ -90,9 +90,12 @@ export default function SearchList({
|
||||
return (
|
||||
<SearchListError
|
||||
getMenuProps={getMenuProps}
|
||||
caption={intl.formatMessage({ id: "Enter destination or hotel" })}
|
||||
caption={intl.formatMessage({
|
||||
defaultMessage: "Enter destination or hotel",
|
||||
})}
|
||||
body={intl.formatMessage({
|
||||
id: "A destination or hotel name is needed to be able to search for a hotel room.",
|
||||
defaultMessage:
|
||||
"A destination or hotel name is needed to be able to search for a hotel room.",
|
||||
})}
|
||||
/>
|
||||
)
|
||||
@@ -102,9 +105,12 @@ export default function SearchList({
|
||||
return (
|
||||
<SearchListError
|
||||
getMenuProps={getMenuProps}
|
||||
caption={intl.formatMessage({ id: "No results" })}
|
||||
caption={intl.formatMessage({
|
||||
defaultMessage: "No results",
|
||||
})}
|
||||
body={intl.formatMessage({
|
||||
id: "We couldn't find a matching location for your search.",
|
||||
defaultMessage:
|
||||
"We couldn't find a matching location for your search.",
|
||||
})}
|
||||
/>
|
||||
)
|
||||
@@ -115,9 +121,12 @@ export default function SearchList({
|
||||
return (
|
||||
<SearchListError
|
||||
getMenuProps={getMenuProps}
|
||||
caption={intl.formatMessage({ id: "Unable to search" })}
|
||||
caption={intl.formatMessage({
|
||||
defaultMessage: "Unable to search",
|
||||
})}
|
||||
body={intl.formatMessage({
|
||||
id: "An error occurred while searching, please try again.",
|
||||
defaultMessage:
|
||||
"An error occurred while searching, please try again.",
|
||||
})}
|
||||
/>
|
||||
)
|
||||
@@ -147,11 +156,14 @@ export default function SearchList({
|
||||
return (
|
||||
<Dialog getMenuProps={getMenuProps} variant="error">
|
||||
<Body className={styles.text} textTransform="bold">
|
||||
{intl.formatMessage({ id: "No results" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "No results",
|
||||
})}
|
||||
</Body>
|
||||
<Body className={styles.text} color="uiTextPlaceholder">
|
||||
{intl.formatMessage({
|
||||
id: "We couldn't find a matching location for your search.",
|
||||
defaultMessage:
|
||||
"We couldn't find a matching location for your search.",
|
||||
})}
|
||||
</Body>
|
||||
{searchHistory && (
|
||||
@@ -162,7 +174,9 @@ export default function SearchList({
|
||||
color="uiTextPlaceholder"
|
||||
textTransform="uppercase"
|
||||
>
|
||||
{intl.formatMessage({ id: "Latest searches" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Latest searches",
|
||||
})}
|
||||
</Footnote>
|
||||
<List
|
||||
getItemProps={getItemProps}
|
||||
@@ -188,7 +202,9 @@ export default function SearchList({
|
||||
return (
|
||||
<Dialog getMenuProps={getMenuProps}>
|
||||
<Footnote color="uiTextPlaceholder" textTransform="uppercase">
|
||||
{intl.formatMessage({ id: "Latest searches" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Latest searches",
|
||||
})}
|
||||
</Footnote>
|
||||
<List
|
||||
getItemProps={getItemProps}
|
||||
@@ -215,14 +231,18 @@ export default function SearchList({
|
||||
<List
|
||||
getItemProps={getItemProps}
|
||||
highlightedIndex={highlightedIndex}
|
||||
label={intl.formatMessage({ id: "Cities" })}
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Cities",
|
||||
})}
|
||||
locations={autocompleteData?.hits.cities ?? []}
|
||||
/>
|
||||
<List
|
||||
getItemProps={getItemProps}
|
||||
highlightedIndex={highlightedIndex}
|
||||
initialIndex={autocompleteData?.hits.cities.length}
|
||||
label={intl.formatMessage({ id: "Hotels" })}
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Hotels",
|
||||
})}
|
||||
locations={autocompleteData?.hits.hotels ?? []}
|
||||
/>
|
||||
</Dialog>
|
||||
|
||||
@@ -89,7 +89,11 @@ export default function Search({ handlePressEnter }: SearchProps) {
|
||||
color={isOpen ? "uiTextActive" : "red"}
|
||||
asChild
|
||||
>
|
||||
<span>{intl.formatMessage({ id: "Where to?" })}</span>
|
||||
<span>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Where to?",
|
||||
})}
|
||||
</span>
|
||||
</Caption>
|
||||
</label>
|
||||
<div {...getRootProps({}, { suppressRefError: true })}>
|
||||
@@ -101,7 +105,7 @@ export default function Search({ handlePressEnter }: SearchProps) {
|
||||
openMenu()
|
||||
},
|
||||
placeholder: intl.formatMessage({
|
||||
id: "Hotels & Destinations",
|
||||
defaultMessage: "Hotels & Destinations",
|
||||
}),
|
||||
value: searchTerm,
|
||||
...register(SEARCH_TERM_NAME, {
|
||||
@@ -138,7 +142,11 @@ export function SearchSkeleton() {
|
||||
<div className={styles.container}>
|
||||
<div className={styles.label}>
|
||||
<Caption type="bold" color="red" asChild>
|
||||
<span>{intl.formatMessage({ id: "Where to?" })}</span>
|
||||
<span>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Where to?",
|
||||
})}
|
||||
</span>
|
||||
</Caption>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user