react-native/website/core/HeaderLinks.js
Hector Ramos 5be8c4af26 Cleanup stray markdown files, update contributing guidelines
Summary:
Several changes here. The `Text.md` and `PixelRatio.md` files were appended to the autodocs during site generation. This seemed excessive for just two files, so I've just merged the content into the autodocs themselves. It should help us simplify the website generation process in the future.

I've also merged IssueGuidelines.md and PullRequestGuidelines.md into the Contribution/Maintainers guidelines to improve their visibility.

Finally, I renamed Help to Community in the nav bar.

Ran the website locally, and verified every page rendered as expected: the Community page, Contributing page, Maintainers page.
Closes https://github.com/facebook/react-native/pull/15374

Differential Revision: D5567400

Pulled By: hramos

fbshipit-source-id: e06056edb12c9a17319fe1af46b2ef3a2e1b5854
2017-08-04 16:18:01 -07:00

61 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
*/
'use strict';
var AlgoliaDocSearch = require('AlgoliaDocSearch');
var React = require('React');
var linksInternal = [
{section: 'docs', href: 'docs/getting-started.html', text: 'Docs', target: '.nav-docs'},
{section: 'support', href: '/react-native/support.html', text: 'Community'},
{section: 'blog', href: '/react-native/blog/', text: 'Blog'},
];
var linksExternal = [
{section: 'github', href: 'https://github.com/facebook/react-native', text: 'GitHub'},
{section: 'react', href: 'http://facebook.github.io/react', text: 'React'},
];
class HeaderLinks extends React.Component {
makeLinks(links) {
return links.map(function(link) {
return (
<li key={link.section}>
<a
href={link.href}
className={link.section === this.props.section ? 'active' : ''}
data-target={link.target}>
{link.text}
</a>
</li>
);
}, this);
}
render() {
return (
<div className="nav-site-wrapper">
<ul className="nav-site nav-site-internal">
{this.makeLinks(linksInternal)}
</ul>
<AlgoliaDocSearch />
<ul className="nav-site nav-site-external">
{this.makeLinks(linksExternal)}
</ul>
</div>
);
}
}
module.exports = HeaderLinks;