feat(SW-706): make eslint rule 'formatjs/no-literal-string-in-jsx' pass
This commit is contained in:
@@ -29,7 +29,9 @@ export default function Campaign({ reward }: { reward: Campaign }) {
|
||||
<Body textAlign="center">{reward.description}</Body>
|
||||
<div className={styles.rewardBadge}>
|
||||
<Caption textAlign="center" color="uiTextHighContrast" type="bold">
|
||||
{intl.formatMessage({ id: "Promo code" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Promo code",
|
||||
})}
|
||||
</Caption>
|
||||
<Caption textAlign="center" color="uiTextHighContrast">
|
||||
{reward.operaRewardId}
|
||||
@@ -41,9 +43,17 @@ export default function Campaign({ reward }: { reward: Campaign }) {
|
||||
onClick={() => {
|
||||
try {
|
||||
navigator.clipboard.writeText(reward.operaRewardId)
|
||||
toast.success(intl.formatMessage({ id: "Copied to clipboard" }))
|
||||
toast.success(
|
||||
intl.formatMessage({
|
||||
defaultMessage: "Copied to clipboard",
|
||||
})
|
||||
)
|
||||
} catch {
|
||||
toast.error(intl.formatMessage({ id: "Failed to copy" }))
|
||||
toast.error(
|
||||
intl.formatMessage({
|
||||
defaultMessage: "Failed to copy",
|
||||
})
|
||||
)
|
||||
}
|
||||
}}
|
||||
type="button"
|
||||
@@ -53,7 +63,9 @@ export default function Campaign({ reward }: { reward: Campaign }) {
|
||||
intent="primary"
|
||||
>
|
||||
<MaterialIcon icon="content_copy" color="CurrentColor" />
|
||||
{intl.formatMessage({ id: "Copy promotion code" })}
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Copy promotion code",
|
||||
})}
|
||||
</Button>
|
||||
</footer>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user