feat(SW-706): make eslint rule 'formatjs/no-literal-string-in-jsx' pass
This commit is contained in:
@@ -11,11 +11,14 @@ export default async function CommunicationSlot() {
|
||||
<section className={styles.container}>
|
||||
<article className={styles.content}>
|
||||
<Subtitle type="two" color="black">
|
||||
{intl.formatMessage({ id: "My communication preferences" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "My communication preferences",
|
||||
})}
|
||||
</Subtitle>
|
||||
<Body color="black">
|
||||
{intl.formatMessage({
|
||||
id: "Tell us what information and updates you'd like to receive, and how, by clicking the link below.",
|
||||
defaultMessage:
|
||||
"Tell us what information and updates you'd like to receive, and how, by clicking the link below.",
|
||||
})}
|
||||
</Body>
|
||||
</article>
|
||||
|
||||
@@ -16,11 +16,14 @@ export default async function CreditCardSlot() {
|
||||
<section className={styles.container}>
|
||||
<article className={styles.content}>
|
||||
<Subtitle type="two" color="black">
|
||||
{intl.formatMessage({ id: "My payment cards" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "My payment cards",
|
||||
})}
|
||||
</Subtitle>
|
||||
<Body color="black">
|
||||
{intl.formatMessage({
|
||||
id: "Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.",
|
||||
defaultMessage:
|
||||
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.",
|
||||
})}
|
||||
</Body>
|
||||
</article>
|
||||
|
||||
@@ -17,7 +17,9 @@ export default async function MembershipCardSlot() {
|
||||
<section className={styles.container}>
|
||||
<article className={styles.content}>
|
||||
<Subtitle color="black">
|
||||
{intl.formatMessage({ id: "My membership cards" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "My membership cards",
|
||||
})}
|
||||
</Subtitle>
|
||||
</article>
|
||||
{membershipCards &&
|
||||
@@ -26,7 +28,9 @@ export default async function MembershipCardSlot() {
|
||||
<div className={styles.card} key={idx}>
|
||||
<Subtitle className={styles.subTitle}>
|
||||
{intl.formatMessage(
|
||||
{ id: "Name: {cardMembershipType}" },
|
||||
{
|
||||
defaultMessage: "Name: {cardMembershipType}",
|
||||
},
|
||||
{
|
||||
cardMembershipType: card.membershipType,
|
||||
}
|
||||
@@ -34,13 +38,17 @@ export default async function MembershipCardSlot() {
|
||||
</Subtitle>
|
||||
<span>
|
||||
{intl.formatMessage(
|
||||
{ id: "Current Points: {points, number}" },
|
||||
{
|
||||
defaultMessage: "Current Points: {points, number}",
|
||||
},
|
||||
{ points: card.currentPoints }
|
||||
)}
|
||||
</span>
|
||||
<span>
|
||||
{intl.formatMessage(
|
||||
{ id: "Member Since: {value}" },
|
||||
{
|
||||
defaultMessage: "Member Since: {value}",
|
||||
},
|
||||
{
|
||||
value: card.memberSince,
|
||||
}
|
||||
@@ -48,7 +56,9 @@ export default async function MembershipCardSlot() {
|
||||
</span>
|
||||
<span>
|
||||
{intl.formatMessage(
|
||||
{ id: "Number: {membershipNumber}" },
|
||||
{
|
||||
defaultMessage: "Number: {membershipNumber}",
|
||||
},
|
||||
{
|
||||
membershipNumber: card.membershipNumber,
|
||||
}
|
||||
@@ -56,7 +66,9 @@ export default async function MembershipCardSlot() {
|
||||
</span>
|
||||
<span>
|
||||
{intl.formatMessage(
|
||||
{ id: "Expiration Date: {expirationDate}" },
|
||||
{
|
||||
defaultMessage: "Expiration Date: {expirationDate}",
|
||||
},
|
||||
{
|
||||
expirationDate: card.expirationDate.split("T")[0],
|
||||
}
|
||||
@@ -67,7 +79,9 @@ export default async function MembershipCardSlot() {
|
||||
<Link href="#" variant="icon">
|
||||
<MaterialIcon icon="add_circle" color="CurrentColor" />
|
||||
<Body color="burgundy" textTransform="underlined">
|
||||
{intl.formatMessage({ id: "Add new card" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Add new card",
|
||||
})}
|
||||
</Body>
|
||||
</Link>
|
||||
</section>
|
||||
|
||||
@@ -55,7 +55,9 @@ export default async function Profile() {
|
||||
const addressOutput =
|
||||
addressParts.length > 0
|
||||
? addressParts.join(", ")
|
||||
: intl.formatMessage({ id: "N/A" })
|
||||
: intl.formatMessage({
|
||||
defaultMessage: "N/A",
|
||||
})
|
||||
|
||||
const userLang = isValidLang(user.language) ? user.language : Lang.en
|
||||
const localizedLanguage = displayNames.language.of(userLang)
|
||||
@@ -69,7 +71,9 @@ export default async function Profile() {
|
||||
<Header>
|
||||
<div>
|
||||
<Title as="h4" color="red" level="h1" textTransform="capitalize">
|
||||
{intl.formatMessage({ id: "Welcome" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Welcome",
|
||||
})}
|
||||
</Title>
|
||||
<Title
|
||||
data-hj-suppress
|
||||
@@ -83,7 +87,9 @@ export default async function Profile() {
|
||||
</div>
|
||||
<Button asChild intent="primary" size="small" theme="base">
|
||||
<Link prefetch={false} color="none" href={profileEdit[lang]}>
|
||||
{intl.formatMessage({ id: "Edit profile" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Edit profile",
|
||||
})}
|
||||
</Link>
|
||||
</Button>
|
||||
</Header>
|
||||
@@ -95,28 +101,36 @@ export default async function Profile() {
|
||||
color="Icon/Interactive/Default"
|
||||
/>
|
||||
<Body color="burgundy" textTransform="bold">
|
||||
{intl.formatMessage({ id: "Date of Birth" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Date of Birth",
|
||||
})}
|
||||
</Body>
|
||||
<Body color="burgundy">{user.dateOfBirth}</Body>
|
||||
</div>
|
||||
<div className={styles.item}>
|
||||
<MaterialIcon icon="phone" color="Icon/Interactive/Default" />
|
||||
<Body color="burgundy" textTransform="bold">
|
||||
{intl.formatMessage({ id: "Phone number" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Phone number",
|
||||
})}
|
||||
</Body>
|
||||
<Body color="burgundy">{user.phoneNumber}</Body>
|
||||
</div>
|
||||
<div className={styles.item}>
|
||||
<MaterialIcon icon="globe" color="Icon/Interactive/Default" />
|
||||
<Body color="burgundy" textTransform="bold">
|
||||
{intl.formatMessage({ id: "Language" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Language",
|
||||
})}
|
||||
</Body>
|
||||
<Body color="burgundy">{normalizedLanguage}</Body>
|
||||
</div>
|
||||
<div className={styles.item}>
|
||||
<MaterialIcon icon="mail" color="Icon/Interactive/Default" />
|
||||
<Body color="burgundy" textTransform="bold">
|
||||
{intl.formatMessage({ id: "Email" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Email",
|
||||
})}
|
||||
</Body>
|
||||
<Body color="burgundy">{user.email}</Body>
|
||||
</div>
|
||||
@@ -126,15 +140,20 @@ export default async function Profile() {
|
||||
color="Icon/Interactive/Default"
|
||||
/>
|
||||
<Body color="burgundy" textTransform="bold">
|
||||
{intl.formatMessage({ id: "Address" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Address",
|
||||
})}
|
||||
</Body>
|
||||
<Body color="burgundy">{addressOutput}</Body>
|
||||
</div>
|
||||
<div className={styles.item}>
|
||||
<MaterialIcon icon="lock" color="Icon/Interactive/Default" />
|
||||
<Body color="burgundy" textTransform="bold">
|
||||
{intl.formatMessage({ id: "Password" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Password",
|
||||
})}
|
||||
</Body>
|
||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||
<Body color="burgundy">**********</Body>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user