chore(SW-667): move formatMessage call to array

This commit is contained in:
Chuma McPhoy
2024-10-28 15:57:33 +01:00
parent d15e76de46
commit 365cb15f90

View File

@@ -12,10 +12,13 @@ export default async function ReadMore() {
const [intl, lang] = await Promise.all([getIntl(), getLang()]) const [intl, lang] = await Promise.all([getIntl(), getLang()])
const links = [ const links = [
{ href: faq[lang], translationId: "FAQ" }, {
href: faq[lang],
text: intl.formatMessage({ id: "FAQ" }),
},
{ {
href: membershipTermsAndConditions[lang], 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}> <article className={styles.wrapper}>
<Subtitle>{intl.formatMessage({ id: "Read more" })}</Subtitle> <Subtitle>{intl.formatMessage({ id: "Read more" })}</Subtitle>
<div className={styles.links}> <div className={styles.links}>
{links.map((link) => { {links.map((link) => (
const translatedText = intl.formatMessage({ id: link.translationId }) <Link
return ( key={link.text}
<Link size="small"
key={link.translationId} className={styles.link}
size="small" color="burgundy"
className={styles.link} href={link.href}
>
<ArrowRight
color="burgundy" color="burgundy"
href={link.href} className={styles.icon}
> height="20"
<ArrowRight width="20"
color="burgundy" />
className={styles.icon} {link.text}
height="20" </Link>
width="20" ))}
/>
{translatedText}
</Link>
)
})}
</div> </div>
</article> </article>
) )