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

@@ -32,14 +32,26 @@ export default function JoinScandicFriendsCard({
}
const list = [
{ title: intl.formatMessage({ id: "Friendly room rates" }) },
{ title: intl.formatMessage({ id: "Earn & spend points" }) },
{ title: intl.formatMessage({ id: "Join for free" }) },
{
title: intl.formatMessage({
defaultMessage: "Friendly room rates",
}),
},
{
title: intl.formatMessage({
defaultMessage: "Earn & spend points",
}),
},
{
title: intl.formatMessage({
defaultMessage: "Join for free",
}),
},
]
const saveOnJoiningLabel = intl.formatMessage(
{
id: "Get the member price: {amount}",
defaultMessage: "Get the member price: {amount}",
},
{
amount: formatPrice(
@@ -62,20 +74,27 @@ export default function JoinScandicFriendsCard({
textTransform="uppercase"
color="uiTextHighContrast"
>
{intl.formatMessage({ id: "Join Scandic Friends" })}
{intl.formatMessage({
defaultMessage: "Join Scandic Friends",
})}
</Caption>
</div>
</Checkbox>
<Footnote color="uiTextHighContrast" className={styles.login}>
{intl.formatMessage({ id: "Already a friend?" })}{" "}
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
{`${intl.formatMessage({
defaultMessage: "Already a friend?",
})} `}
<LoginButton
color="burgundy"
position="enter details"
trackingId="join-scandic-friends-enter-details"
variant="breadcrumb"
>
{intl.formatMessage({ id: "Log in" })}
{intl.formatMessage({
defaultMessage: "Log in",
})}
</LoginButton>
</Footnote>
@@ -99,7 +118,8 @@ export default function JoinScandicFriendsCard({
<Footnote color="uiTextPlaceholder">
{intl.formatMessage(
{
id: "By signing up you accept the Scandic Friends <termsAndConditionsLink>Terms and Conditions</termsAndConditionsLink>. Your membership is valid until further notice, and you can terminate your membership at any time by sending an email to Scandic's customer service",
defaultMessage:
"By signing up you accept the Scandic Friends <termsAndConditionsLink>Terms and Conditions</termsAndConditionsLink>. Your membership is valid until further notice, and you can terminate your membership at any time by sending an email to Scandic's customer service",
},
{
termsAndConditionsLink: (str) => (

View File

@@ -42,7 +42,7 @@ export default function MemberPriceModal({
<MagicWandIcon width="265px" />
<Title as="h3" level="h1" textTransform="regular">
{intl.formatMessage({
id: "Member price activated",
defaultMessage: "Member price activated",
})}
</Title>
@@ -50,7 +50,7 @@ export default function MemberPriceModal({
<span className={styles.newPrice}>
<Body>
{intl.formatMessage({
id: "The new price is",
defaultMessage: "The new price is",
})}
</Body>
<Subtitle type="two" color="red">
@@ -64,7 +64,9 @@ export default function MemberPriceModal({
)}
</div>
<Button intent="primary" theme="base" onClick={() => setIsOpen(false)}>
{intl.formatMessage({ id: "OK" })}
{intl.formatMessage({
defaultMessage: "OK",
})}
</Button>
</div>
</Modal>

View File

@@ -27,14 +27,18 @@ export default function Signup({ name }: { name: string }) {
<div className={styles.additionalFormData}>
<Input
name="zipCode"
label={intl.formatMessage({ id: "Zip code" })}
label={intl.formatMessage({
defaultMessage: "Zip code",
})}
registerOptions={{ required: true }}
/>
<div className={styles.dateField}>
<header>
<Caption type="bold">
<span className={styles.required}>
{intl.formatMessage({ id: "Birth date" })}
{intl.formatMessage({
defaultMessage: "Birth date",
})}
</span>
</Caption>
</header>
@@ -43,7 +47,9 @@ export default function Signup({ name }: { name: string }) {
</div>
) : (
<Input
label={intl.formatMessage({ id: "Membership no" })}
label={intl.formatMessage({
defaultMessage: "Membership no",
})}
name="membershipNo"
type="tel"
/>

View File

@@ -93,17 +93,23 @@ export default function Details({ user }: DetailsProps) {
type="label"
className={styles.fullWidth}
>
{intl.formatMessage({ id: "Guest information" })}
{intl.formatMessage({
defaultMessage: "Guest information",
})}
</Footnote>
<Input
label={intl.formatMessage({ id: "First name" })}
label={intl.formatMessage({
defaultMessage: "First name",
})}
maxLength={30}
name="firstName"
readOnly={!!user}
registerOptions={{ required: true }}
/>
<Input
label={intl.formatMessage({ id: "Last name" })}
label={intl.formatMessage({
defaultMessage: "Last name",
})}
maxLength={30}
name="lastName"
readOnly={!!user}
@@ -111,21 +117,27 @@ export default function Details({ user }: DetailsProps) {
/>
<CountrySelect
className={styles.fullWidth}
label={intl.formatMessage({ id: "Country" })}
label={intl.formatMessage({
defaultMessage: "Country",
})}
name="countryCode"
readOnly={!!user}
registerOptions={{ required: true }}
/>
<Input
className={styles.fullWidth}
label={intl.formatMessage({ id: "Email address" })}
label={intl.formatMessage({
defaultMessage: "Email address",
})}
name="email"
readOnly={!!user}
registerOptions={{ required: true }}
/>
<Phone
className={styles.fullWidth}
label={intl.formatMessage({ id: "Phone number" })}
label={intl.formatMessage({
defaultMessage: "Phone number",
})}
name="phoneNumber"
readOnly={!!user}
registerOptions={{ required: true }}
@@ -151,9 +163,13 @@ export default function Details({ user }: DetailsProps) {
type="submit"
>
{isPaymentNext
? intl.formatMessage({ id: "Continue" })
? intl.formatMessage({
defaultMessage: "Continue",
})
: intl.formatMessage(
{ id: "Continue to room {nextRoomNumber}" },
{
defaultMessage: "Continue to room {nextRoomNumber}",
},
{ nextRoomNumber: roomNr + 1 }
)}
</Button>