Skip to content

Commit bc31e24

Browse files
committed
refactor: remove component definition during render
1 parent 23d2933 commit bc31e24

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/pages/about.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ const YELLOW_PAPERS = {
4949
zh: YellowPaperZH,
5050
};
5151

52+
const Anchor = (intl) => ((children) => (
53+
<a href={WHITE_PAPERS[intl.locale] || WHITE_PAPERS[intl.defaultLocale]} rel="noopener noreferrer" target="_blank">
54+
{children}
55+
</a>
56+
));
57+
5258
const About = ({ intl }) => (
5359
<Layout>
5460
<SEO lang={intl.locale} title={intl.formatMessage({ id: "about.seo-title" })} />
@@ -61,11 +67,7 @@ const About = ({ intl }) => (
6167
<FormattedMessage
6268
id="about.section-hero.h2"
6369
values={{
64-
anchor: (children) => (
65-
<a href={WHITE_PAPERS[intl.locale] || WHITE_PAPERS[intl.defaultLocale]} rel="noopener noreferrer" target="_blank">
66-
{children}
67-
</a>
68-
),
70+
anchor: Anchor(intl)
6971
}}
7072
/>
7173
</h2>

0 commit comments

Comments
 (0)