feat(SW-706): make eslint rule 'formatjs/no-literal-string-in-jsx' pass
This commit is contained in:
@@ -32,14 +32,16 @@ function useAddCardResultToast() {
|
||||
if (success) {
|
||||
setTimeout(() => {
|
||||
toast.success(
|
||||
intl.formatMessage({ id: "Your card was successfully saved!" })
|
||||
intl.formatMessage({
|
||||
defaultMessage: "Your card was successfully saved!",
|
||||
})
|
||||
)
|
||||
})
|
||||
} else if (cancel) {
|
||||
setTimeout(() => {
|
||||
toast.warning(
|
||||
intl.formatMessage({
|
||||
id: "You canceled adding a new credit card.",
|
||||
defaultMessage: "You canceled adding a new credit card.",
|
||||
})
|
||||
)
|
||||
})
|
||||
@@ -47,7 +49,8 @@ function useAddCardResultToast() {
|
||||
setTimeout(() => {
|
||||
toast.error(
|
||||
intl.formatMessage({
|
||||
id: "Something went wrong and we couldn't add your card. Please try again later.",
|
||||
defaultMessage:
|
||||
"Something went wrong and we couldn't add your card. Please try again later.",
|
||||
})
|
||||
)
|
||||
})
|
||||
@@ -72,7 +75,8 @@ export default function AddCreditCardButton() {
|
||||
} else {
|
||||
toast.error(
|
||||
intl.formatMessage({
|
||||
id: "We could not add a card right now, please try again later.",
|
||||
defaultMessage:
|
||||
"We could not add a card right now, please try again later.",
|
||||
})
|
||||
)
|
||||
}
|
||||
@@ -80,7 +84,8 @@ export default function AddCreditCardButton() {
|
||||
onError: () => {
|
||||
toast.error(
|
||||
intl.formatMessage({
|
||||
id: "An error occurred when adding a credit card, please try again later.",
|
||||
defaultMessage:
|
||||
"An error occurred when adding a credit card, please try again later.",
|
||||
})
|
||||
)
|
||||
},
|
||||
@@ -100,7 +105,9 @@ export default function AddCreditCardButton() {
|
||||
wrapping
|
||||
>
|
||||
<MaterialIcon icon="add_circle" color="CurrentColor" />
|
||||
{intl.formatMessage({ id: "Add new card" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Add new card",
|
||||
})}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -20,13 +20,16 @@ export default function DeleteCreditCardButton({
|
||||
onSuccess() {
|
||||
trpcUtils.user.creditCards.invalidate()
|
||||
toast.success(
|
||||
intl.formatMessage({ id: "Credit card deleted successfully" })
|
||||
intl.formatMessage({
|
||||
defaultMessage: "Credit card deleted successfully",
|
||||
})
|
||||
)
|
||||
},
|
||||
onError() {
|
||||
toast.error(
|
||||
intl.formatMessage({
|
||||
id: "Failed to delete credit card, please try again later.",
|
||||
defaultMessage:
|
||||
"Failed to delete credit card, please try again later.",
|
||||
})
|
||||
)
|
||||
},
|
||||
|
||||
@@ -22,13 +22,16 @@ export default function DeleteCreditCardConfirmation({
|
||||
trpcUtils.user.creditCards.invalidate()
|
||||
|
||||
toast.success(
|
||||
intl.formatMessage({ id: "Your card was successfully removed!" })
|
||||
intl.formatMessage({
|
||||
defaultMessage: "Your card was successfully removed!",
|
||||
})
|
||||
)
|
||||
},
|
||||
onError() {
|
||||
toast.error(
|
||||
intl.formatMessage({
|
||||
id: "Something went wrong and we couldn't remove your card. Please try again later.",
|
||||
defaultMessage:
|
||||
"Something went wrong and we couldn't remove your card. Please try again later.",
|
||||
})
|
||||
)
|
||||
},
|
||||
@@ -42,7 +45,8 @@ export default function DeleteCreditCardConfirmation({
|
||||
|
||||
const bodyText = intl.formatMessage(
|
||||
{
|
||||
id: "Are you sure you want to remove the card ending with {lastFourDigits} from your member profile?",
|
||||
defaultMessage:
|
||||
"Are you sure you want to remove the card ending with {lastFourDigits} from your member profile?",
|
||||
},
|
||||
{ lastFourDigits }
|
||||
)
|
||||
@@ -50,10 +54,16 @@ export default function DeleteCreditCardConfirmation({
|
||||
return (
|
||||
<Dialog
|
||||
bodyText={bodyText}
|
||||
cancelButtonText={intl.formatMessage({ id: "No, keep card" })}
|
||||
cancelButtonText={intl.formatMessage({
|
||||
defaultMessage: "No, keep card",
|
||||
})}
|
||||
proceedOnClick={handleProceedDeleteCard}
|
||||
proceedText={intl.formatMessage({ id: "Yes, remove my card" })}
|
||||
titleText={intl.formatMessage({ id: "Remove card from member profile" })}
|
||||
proceedText={intl.formatMessage({
|
||||
defaultMessage: "Yes, remove my card",
|
||||
})}
|
||||
titleText={intl.formatMessage({
|
||||
defaultMessage: "Remove card from member profile",
|
||||
})}
|
||||
trigger={
|
||||
<Button intent="secondary" size="small" theme="base">
|
||||
<MaterialIcon icon="delete" color="Icon/Interactive/Default" />
|
||||
|
||||
@@ -21,7 +21,8 @@ export default function ManagePreferencesButton() {
|
||||
} else {
|
||||
toast.error(
|
||||
intl.formatMessage({
|
||||
id: "It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.",
|
||||
defaultMessage:
|
||||
"It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.",
|
||||
})
|
||||
)
|
||||
}
|
||||
@@ -29,7 +30,8 @@ export default function ManagePreferencesButton() {
|
||||
onError: () => {
|
||||
toast.error(
|
||||
intl.formatMessage({
|
||||
id: "An error occurred trying to manage your preferences, please try again later.",
|
||||
defaultMessage:
|
||||
"An error occurred trying to manage your preferences, please try again later.",
|
||||
})
|
||||
)
|
||||
},
|
||||
@@ -46,7 +48,9 @@ export default function ManagePreferencesButton() {
|
||||
wrapping
|
||||
>
|
||||
<MaterialIcon icon="arrow_forward" color="CurrentColor" />
|
||||
{intl.formatMessage({ id: "Manage preferences" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Manage preferences",
|
||||
})}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user