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

@@ -20,18 +20,25 @@ export function AlreadyLinkedError() {
<SASModal>
<MaterialIcon icon="cancel" isFilled size={64} />
<Typography variant="Title/Subtitle/lg">
<h1>{intl.formatMessage({ id: "Accounts are already linked" })}</h1>
<h1>
{intl.formatMessage({
defaultMessage: "Accounts are already linked",
})}
</h1>
</Typography>
<Typography variant="Body/Paragraph/mdRegular">
<p>
{intl.formatMessage({
id: "Looks like youve already linked your Scandic Friends and SAS EuroBonus accounts!",
defaultMessage:
"Looks like youve already linked your Scandic Friends and SAS EuroBonus accounts!",
})}
</p>
</Typography>
<Button theme="base" asChild>
<Link href={partnerSas[lang]}>
{intl.formatMessage({ id: "View your linked accounts" })}
{intl.formatMessage({
defaultMessage: "View your linked accounts",
})}
</Link>
</Button>
<SASModalDivider />

View File

@@ -25,18 +25,25 @@ export function DateOfBirthError() {
size={64}
/>
<Typography variant="Title/Subtitle/lg">
<h1>{intl.formatMessage({ id: "Date of birth not matching" })}</h1>
<h1>
{intl.formatMessage({
defaultMessage: "Date of birth not matching",
})}
</h1>
</Typography>
<Typography variant="Body/Paragraph/mdRegular">
<p>
{intl.formatMessage({
id: "We couldnt connect your accounts. Please contact us and well help you resolve this.",
defaultMessage:
"We couldnt connect your accounts. Please contact us and well help you resolve this.",
})}
</p>
</Typography>
<Button theme="base" asChild>
<Link href={profile[lang]}>
{intl.formatMessage({ id: "View your details" })}
{intl.formatMessage({
defaultMessage: "View your details",
})}
</Link>
</Button>
<SASModalDivider />

View File

@@ -13,18 +13,22 @@ export function FailedAttemptsError() {
return (
<GenericError
title={intl.formatMessage({ id: "Too many failed attempts" })}
title={intl.formatMessage({
defaultMessage: "Too many failed attempts",
})}
variant="info"
>
<Typography variant="Body/Paragraph/mdRegular">
<p>
{intl.formatMessage({
id: "Please wait 1 hour before trying again.",
defaultMessage: "Please wait 1 hour before trying again.",
})}
</p>
</Typography>
<Button theme="base" disabled>
{intl.formatMessage({ id: "Send new code" })}
{intl.formatMessage({
defaultMessage: "Send new code",
})}
</Button>
</GenericError>
)

View File

@@ -18,7 +18,11 @@ export function SASModalDivider() {
return (
<div className={styles.divider}>
<Typography variant="Body/Paragraph/mdRegular">
<span>{intl.formatMessage({ id: "or" })}</span>
<span>
{intl.formatMessage({
defaultMessage: "or",
})}
</span>
</Typography>
</div>
)
@@ -27,13 +31,17 @@ export function SASModalDivider() {
export function SASModalContactBlock() {
const intl = useIntl()
const phone = intl.formatMessage({ id: "+46 8 517 517 00" })
const phone = intl.formatMessage({
defaultMessage: "+46 8 517 517 00",
})
return (
<div style={{ display: "flex", flexDirection: "column" }}>
<Typography variant="Title/Subtitle/md">
<h4 className={styles.contactBlockTitle}>
{intl.formatMessage({ id: "Contact us" })}
{intl.formatMessage({
defaultMessage: "Contact us",
})}
</h4>
</Typography>
<Link
@@ -42,6 +50,7 @@ export function SASModalContactBlock() {
>
{phone}
</Link>
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
<Link href="mailto:member@scandichotels.com" textDecoration="underline">
member@scandichotels.com
</Link>

View File

@@ -13,18 +13,22 @@ export function TooManyCodesError() {
return (
<GenericError
title={intl.formatMessage({ id: "Youve requested too many codes" })}
title={intl.formatMessage({
defaultMessage: "Youve requested too many codes",
})}
variant="info"
>
<Typography variant="Body/Paragraph/mdRegular">
<p>
{intl.formatMessage({
id: "Please wait 1 hour before trying again.",
defaultMessage: "Please wait 1 hour before trying again.",
})}
</p>
</Typography>
<Button theme="base" disabled>
{intl.formatMessage({ id: "Send new code" })}
{intl.formatMessage({
defaultMessage: "Send new code",
})}
</Button>
</GenericError>
)

View File

@@ -13,18 +13,22 @@ export function TooManyFailedAttemptsError() {
return (
<GenericError
title={intl.formatMessage({ id: "Too many failed attempts." })}
title={intl.formatMessage({
defaultMessage: "Too many failed attempts.",
})}
variant="info"
>
<Typography variant="Body/Paragraph/mdRegular">
<p>
{intl.formatMessage({
id: "Please wait 1 hour before trying again.",
defaultMessage: "Please wait 1 hour before trying again.",
})}
</p>
</Typography>
<Button theme="base" disabled>
{intl.formatMessage({ id: "Send new code" })}
{intl.formatMessage({
defaultMessage: "Send new code",
})}
</Button>
</GenericError>
)