Skip to content

Commit 46307f7

Browse files
Refactor Navigation
1 parent c634e6a commit 46307f7

File tree

1 file changed

+27
-33
lines changed

1 file changed

+27
-33
lines changed

src/components/Navigation/Navigation.js

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,36 @@ import { FormattedMessage } from 'react-intl';
44
import ChangeLanguage from '../ChangeLanguage/ChangeLanguage';
55
import './Navigation.scss';
66

7+
const Item = ({ link, text }) => (
8+
<li>
9+
<A href={link}>{text}</A>
10+
</li>
11+
);
12+
13+
const Menu = () => (
14+
<ul className="left">
15+
<Item link="/" text={<FormattedMessage id="IDS_HOME_PAGE" />} />
16+
<Item link="/terms" text={<FormattedMessage id="IDS_TERMS_OF_USE" />} />
17+
<Item link="/privacy" text={<FormattedMessage id="IDS_PRIVACY_POLICY" />} />
18+
<Item
19+
link="/blog/1"
20+
text={
21+
<FormattedMessage id="IDS_BLOG_PAGE_WITH_ID" values={{ blogId: 1 }} />
22+
}
23+
/>
24+
<Item
25+
link="/blog/2"
26+
text={
27+
<FormattedMessage id="IDS_BLOG_PAGE_WITH_ID" values={{ blogId: 2 }} />
28+
}
29+
/>
30+
</ul>
31+
);
32+
733
const Navigation = () => {
834
return (
935
<div className="navigation-container">
10-
<ul className="left">
11-
<li>
12-
<A href="/">
13-
<FormattedMessage id="IDS_HOME_PAGE" />
14-
</A>
15-
</li>
16-
<li>
17-
<A href="/terms">
18-
<FormattedMessage id="IDS_TERMS_OF_USE" />
19-
</A>
20-
</li>
21-
<li>
22-
<A href="/privacy">
23-
<FormattedMessage id="IDS_PRIVACY_POLICY" />
24-
</A>
25-
</li>
26-
<li>
27-
<A href="/blog/1">
28-
<FormattedMessage
29-
id="IDS_BLOG_PAGE_WITH_ID"
30-
values={{ blogId: 1 }}
31-
/>
32-
</A>
33-
</li>
34-
<li>
35-
<A href="/blog/2">
36-
<FormattedMessage
37-
id="IDS_BLOG_PAGE_WITH_ID"
38-
values={{ blogId: 2 }}
39-
/>
40-
</A>
41-
</li>
42-
</ul>
36+
<Menu />
4337
<ChangeLanguage />
4438
</div>
4539
);

0 commit comments

Comments
 (0)