chore(SW-667): move formatMessage call to array
This commit is contained in:
@@ -12,10 +12,13 @@ export default async function ReadMore() {
|
||||
const [intl, lang] = await Promise.all([getIntl(), getLang()])
|
||||
|
||||
const links = [
|
||||
{ href: faq[lang], translationId: "FAQ" },
|
||||
{
|
||||
href: faq[lang],
|
||||
text: intl.formatMessage({ id: "FAQ" }),
|
||||
},
|
||||
{
|
||||
href: membershipTermsAndConditions[lang],
|
||||
translationId: "Membership terms and conditions",
|
||||
text: intl.formatMessage({ id: "Membership terms and conditions" }),
|
||||
},
|
||||
]
|
||||
|
||||
@@ -23,26 +26,23 @@ export default async function ReadMore() {
|
||||
<article className={styles.wrapper}>
|
||||
<Subtitle>{intl.formatMessage({ id: "Read more" })}</Subtitle>
|
||||
<div className={styles.links}>
|
||||
{links.map((link) => {
|
||||
const translatedText = intl.formatMessage({ id: link.translationId })
|
||||
return (
|
||||
<Link
|
||||
key={link.translationId}
|
||||
size="small"
|
||||
className={styles.link}
|
||||
{links.map((link) => (
|
||||
<Link
|
||||
key={link.text}
|
||||
size="small"
|
||||
className={styles.link}
|
||||
color="burgundy"
|
||||
href={link.href}
|
||||
>
|
||||
<ArrowRight
|
||||
color="burgundy"
|
||||
href={link.href}
|
||||
>
|
||||
<ArrowRight
|
||||
color="burgundy"
|
||||
className={styles.icon}
|
||||
height="20"
|
||||
width="20"
|
||||
/>
|
||||
{translatedText}
|
||||
</Link>
|
||||
)
|
||||
})}
|
||||
className={styles.icon}
|
||||
height="20"
|
||||
width="20"
|
||||
/>
|
||||
{link.text}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</article>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user