Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: remove component definition during render
  • Loading branch information
alcercu committed Jan 9, 2023
commit bc31e24ccfde2bf9f1aa052eddefeba6a6950a9b
12 changes: 7 additions & 5 deletions src/pages/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ const YELLOW_PAPERS = {
zh: YellowPaperZH,
};

const Anchor = (intl) => ((children) => (
<a href={WHITE_PAPERS[intl.locale] || WHITE_PAPERS[intl.defaultLocale]} rel="noopener noreferrer" target="_blank">
{children}
</a>
));

const About = ({ intl }) => (
<Layout>
<SEO lang={intl.locale} title={intl.formatMessage({ id: "about.seo-title" })} />
Expand All @@ -61,11 +67,7 @@ const About = ({ intl }) => (
<FormattedMessage
id="about.section-hero.h2"
values={{
anchor: (children) => (
<a href={WHITE_PAPERS[intl.locale] || WHITE_PAPERS[intl.defaultLocale]} rel="noopener noreferrer" target="_blank">
{children}
</a>
),
anchor: Anchor(intl)
}}
/>
</h2>
Expand Down