Skip to content

Commit 2d23c2f

Browse files
committed
Switch nav design
1 parent 684cfed commit 2d23c2f

2 files changed

Lines changed: 45 additions & 26 deletions

File tree

website/core/HeaderLinks.js

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,39 @@
1212
var React = require('React');
1313

1414
var HeaderLinks = React.createClass({
15-
links: [
16-
{section: 'docs', href: '/react-native/docs/getting-started.html#content', text: 'docs'},
17-
{section: 'support', href: '/react-native/support.html', text: 'support'},
18-
{section: 'react', href: 'http://facebook.github.io/react', text: 'react'},
19-
{section: 'github', href: 'http://github.com/facebook/react-native', text: 'github'},
15+
linksInternal: [
16+
{section: 'docs', href: '/react-native/docs/getting-started.html#content', text: 'Docs'},
17+
{section: 'support', href: '/react-native/support.html', text: 'Support'},
2018
],
19+
linksExternal: [
20+
{section: 'github', href: 'http://github.com/facebook/react-native', text: 'GitHub'},
21+
{section: 'react', href: 'http://facebook.github.io/react', text: 'React'},
22+
],
23+
24+
makeLinks: function(links) {
25+
return links.map(function(link) {
26+
return (
27+
<li key={link.section}>
28+
<a
29+
href={link.href}
30+
className={link.section === this.props.section ? 'active' : ''}>
31+
{link.text}
32+
</a>
33+
</li>
34+
);
35+
}, this)
36+
},
2137

2238
render: function() {
2339
return (
24-
<ul className="nav-site">
25-
{this.links.map(function(link) {
26-
return (
27-
<li key={link.section}>
28-
<a
29-
href={link.href}
30-
className={link.section === this.props.section ? 'active' : ''}>
31-
{link.text}
32-
</a>
33-
</li>
34-
);
35-
}, this)}
36-
</ul>
40+
<div className="nav-site-wrapper">
41+
<ul className="nav-site nav-site-internal">
42+
{this.makeLinks(this.linksInternal)}
43+
</ul>
44+
<ul className="nav-site nav-site-external">
45+
{this.makeLinks(this.linksExternal)}
46+
</ul>
47+
</div>
3748
);
3849
}
3950
});

website/src/react-native/css/react-native.css

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,15 @@ h1:hover .hash-link, h2:hover .hash-link, h3:hover .hash-link, h4:hover .hash-li
249249
text-decoration: none;
250250
}
251251

252-
.nav-main .nav-site {
252+
.nav-main .nav-site-wrapper {
253+
display: inline;
254+
}
255+
256+
.nav-main .nav-site-internal {
257+
margin: 0 0 0 20px;
258+
}
259+
260+
.nav-main .nav-site-external {
253261
float: right;
254262
margin: 0;
255263
}
@@ -259,21 +267,20 @@ h1:hover .hash-link, h2:hover .hash-link, h3:hover .hash-link, h4:hover .hash-li
259267
}
260268

261269
.nav-main .nav-site a {
262-
padding: 0 8px;
263-
text-transform: uppercase;
264-
letter-spacing: 1px;
270+
box-sizing: content-box;
271+
padding: 0 10px;
265272
line-height: 50px;
266273
display: inline-block;
267274
height: 50px;
268-
color: #aaa;
275+
color: #ddd;
269276
}
270277

271278
.nav-main .nav-site a:hover {
272-
color: #fafafa;
279+
color: #fff;
273280
}
274281

275282
.nav-main .nav-site a.active {
276-
color: #fafafa;
283+
color: #fff;
277284
border-bottom: 3px solid #05A5D1;
278285
background: #333;
279286
}
@@ -294,7 +301,8 @@ h1:hover .hash-link, h2:hover .hash-link, h3:hover .hash-link, h4:hover .hash-li
294301
}
295302

296303
.nav-main ul {
297-
display: inline;
304+
display: inline-block;
305+
vertical-align: top;
298306
}
299307

300308
.nav-main li {

0 commit comments

Comments
 (0)