mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-17 11:27:05 +08:00
Summary:This pull request moves the content of the Releases tab to the version number next to the title. With the search bar, the header was getting too crowded. - I've cleaned up the search style a bit and made it look like the React one (with the background color). - I've also improved the styling of the versions page.  Closes https://github.com/facebook/react-native/pull/6388 Differential Revision: D3033151 Pulled By: vjeux fb-gh-sync-id: ec44f8f1a50331cd001c6cb7723f084751c342ab shipit-source-id: ec44f8f1a50331cd001c6cb7723f084751c342ab
59 lines
1.6 KiB
JavaScript
59 lines
1.6 KiB
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule HeaderLinks
|
|
*/
|
|
|
|
var React = require('React');
|
|
var AlgoliaDocSearch = require('AlgoliaDocSearch');
|
|
|
|
var HeaderLinks = React.createClass({
|
|
linksInternal: [
|
|
{section: 'docs', href: 'docs/getting-started.html', text: 'Docs'},
|
|
{section: 'support', href: 'support.html', text: 'Support'},
|
|
{section: 'newsletter', href: 'http://reactnative.cc', text: 'Newsletter'},
|
|
{section: 'showcase', href: 'showcase.html', text: 'Showcase'},
|
|
],
|
|
linksExternal: [
|
|
{section: 'github', href: 'https://github.com/facebook/react-native', text: 'GitHub'},
|
|
{section: 'react', href: 'http://facebook.github.io/react', text: 'React'},
|
|
],
|
|
|
|
makeLinks: function(links) {
|
|
return links.map(function(link) {
|
|
return (
|
|
<li key={link.section}>
|
|
<a
|
|
href={link.href}
|
|
className={link.section === this.props.section ? 'active' : ''}>
|
|
{link.text}
|
|
</a>
|
|
</li>
|
|
);
|
|
}, this)
|
|
},
|
|
|
|
render: function() {
|
|
return (
|
|
<div className="nav-site-wrapper">
|
|
<ul className="nav-site nav-site-internal">
|
|
{this.makeLinks(this.linksInternal)}
|
|
</ul>
|
|
|
|
<AlgoliaDocSearch />
|
|
|
|
<ul className="nav-site nav-site-external">
|
|
{this.makeLinks(this.linksExternal)}
|
|
</ul>
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
|
|
module.exports = HeaderLinks;
|