2015-02-12 04:26:43 +00:00
|
|
|
/**
|
2015-03-23 17:55:49 +00:00
|
|
|
* 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.
|
|
|
|
*
|
2015-02-12 04:26:43 +00:00
|
|
|
* @providesModule Site
|
|
|
|
*/
|
2016-11-21 01:49:21 +00:00
|
|
|
'use strict';
|
2015-02-12 04:26:43 +00:00
|
|
|
|
|
|
|
var HeaderLinks = require('HeaderLinks');
|
2016-02-11 14:16:34 +00:00
|
|
|
var Metadata = require('Metadata');
|
2016-11-21 01:49:21 +00:00
|
|
|
var React = require('React');
|
2015-02-12 04:26:43 +00:00
|
|
|
|
|
|
|
var Site = React.createClass({
|
|
|
|
render: function() {
|
2016-02-11 14:16:34 +00:00
|
|
|
const path = Metadata.config.RN_DEPLOYMENT_PATH;
|
2016-02-12 19:57:01 +00:00
|
|
|
const version = Metadata.config.RN_VERSION;
|
2016-03-09 21:57:54 +00:00
|
|
|
const algoliaVersion = version === 'next' ? 'master' : version;
|
2016-02-11 14:16:34 +00:00
|
|
|
var basePath = '/react-native/' + (path ? path + '/' : '');
|
2016-02-10 00:21:52 +00:00
|
|
|
var currentYear = (new Date()).getFullYear();
|
2016-08-30 06:08:50 +00:00
|
|
|
|
|
|
|
var title = this.props.title ? this.props.title : 'React Native | A framework for building native apps using React';
|
|
|
|
|
|
|
|
var metaTags = [
|
2016-11-21 01:49:21 +00:00
|
|
|
{ charSet: 'utf-8' },
|
2016-08-30 06:08:50 +00:00
|
|
|
{
|
2016-11-21 01:49:21 +00:00
|
|
|
httpEquiv: 'X-UA-Compatible',
|
|
|
|
content: 'IE=edge,chrome=1',
|
2016-08-30 06:08:50 +00:00
|
|
|
},
|
|
|
|
{
|
2016-11-21 01:49:21 +00:00
|
|
|
name: 'viewport',
|
|
|
|
content: 'width=device-width',
|
2016-08-30 06:08:50 +00:00
|
|
|
},
|
|
|
|
// Facebook
|
2016-11-21 01:49:21 +00:00
|
|
|
{ property: 'fb:app_id', content: '1677033832619985', },
|
|
|
|
{ property: 'fb:admins', content: '121800083', },
|
2016-08-30 06:08:50 +00:00
|
|
|
// Open Graph
|
|
|
|
{
|
2016-11-21 01:49:21 +00:00
|
|
|
property: 'og:site_name',
|
|
|
|
content: 'React Native',
|
2016-08-30 06:08:50 +00:00
|
|
|
},
|
|
|
|
{
|
2016-11-21 01:49:21 +00:00
|
|
|
property: 'og:title',
|
2016-08-30 06:08:50 +00:00
|
|
|
content: title,
|
|
|
|
},
|
|
|
|
{
|
2016-11-21 01:49:21 +00:00
|
|
|
property: 'og:url',
|
|
|
|
content: 'https://facebook.github.io/react-native/' + (this.props.path ? this.props.path : 'index.html'),
|
2016-08-30 06:08:50 +00:00
|
|
|
},
|
|
|
|
{
|
2016-11-21 01:49:21 +00:00
|
|
|
property: 'og:image',
|
|
|
|
content: this.props.image ? this.props.image : 'https://facebook.github.io/react-native/img/opengraph.png',
|
2016-08-30 06:08:50 +00:00
|
|
|
},
|
|
|
|
{
|
2016-11-21 01:49:21 +00:00
|
|
|
property: 'og:description',
|
|
|
|
content: this.props.description ? this.props.description : 'A framework for building native apps using React',
|
2016-08-30 06:08:50 +00:00
|
|
|
},
|
|
|
|
// Twitter Cards
|
|
|
|
{
|
2016-11-21 01:49:21 +00:00
|
|
|
name: 'twitter:site',
|
|
|
|
content: '@reactnative',
|
2016-08-30 06:08:50 +00:00
|
|
|
},
|
|
|
|
{
|
2016-11-21 01:49:21 +00:00
|
|
|
name: 'twitter:card',
|
|
|
|
content: 'summary_large_image',
|
2016-08-30 06:08:50 +00:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
var typeTags = [{
|
2016-11-21 01:49:21 +00:00
|
|
|
property: 'og:type',
|
|
|
|
content: 'website',
|
2016-08-30 06:08:50 +00:00
|
|
|
}];
|
|
|
|
if (this.props.author) {
|
|
|
|
typeTags = [{
|
2016-11-21 01:49:21 +00:00
|
|
|
property: 'og:type',
|
|
|
|
content: 'article',
|
2016-08-30 06:08:50 +00:00
|
|
|
}, {
|
2016-11-21 01:49:21 +00:00
|
|
|
property: 'article:author',
|
2016-08-30 06:08:50 +00:00
|
|
|
content: this.props.author,
|
|
|
|
}];
|
|
|
|
}
|
|
|
|
metaTags.push(...typeTags);
|
|
|
|
|
|
|
|
if (this.props.authorTwitter) {
|
|
|
|
metaTags.push({
|
2016-11-21 01:49:21 +00:00
|
|
|
name: 'twitter:creator',
|
|
|
|
content: '@' + this.props.authorTwitter,
|
2016-08-30 06:08:50 +00:00
|
|
|
});
|
|
|
|
}
|
2016-08-25 18:02:27 +00:00
|
|
|
|
2015-02-12 04:26:43 +00:00
|
|
|
return (
|
|
|
|
<html>
|
|
|
|
<head>
|
2015-08-02 11:45:40 +00:00
|
|
|
<title>{title}</title>
|
2016-08-30 06:08:50 +00:00
|
|
|
{
|
2016-08-30 17:56:48 +00:00
|
|
|
metaTags.map((tag, index) =>
|
|
|
|
<meta key={index} {...tag} />)
|
2016-08-30 06:08:50 +00:00
|
|
|
}
|
2015-02-12 04:26:43 +00:00
|
|
|
|
2016-02-11 14:16:34 +00:00
|
|
|
<base href={basePath} />
|
|
|
|
|
2015-12-29 17:43:40 +00:00
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" />
|
|
|
|
|
2016-02-11 14:16:34 +00:00
|
|
|
<link rel="shortcut icon" href="img/favicon.png?2" />
|
|
|
|
<link rel="stylesheet" href="css/react-native.css" />
|
2015-02-12 04:26:43 +00:00
|
|
|
|
2016-11-02 12:31:52 +00:00
|
|
|
<link rel="alternate" type="application/rss+xml" title="React Native Blog" href="https://facebook.github.io/react-native/blog/feed.xml" />
|
|
|
|
<link href="//cdn-images.mailchimp.com/embedcode/horizontal-slim-10_7.css" rel="stylesheet" type="text/css" />
|
|
|
|
|
2016-11-21 01:49:21 +00:00
|
|
|
<script type="text/javascript" src="//use.typekit.net/vqa1hcx.js" />
|
2015-02-12 04:26:43 +00:00
|
|
|
<script type="text/javascript">{'try{Typekit.load();}catch(e){}'}</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2016-11-21 01:49:21 +00:00
|
|
|
<script dangerouslySetInnerHTML={{__html: "window.fbAsyncInit = function() {FB.init({appId:'1677033832619985',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));"}} />
|
|
|
|
<script dangerouslySetInnerHTML={{__html: "window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));"}} />
|
2015-02-12 04:26:43 +00:00
|
|
|
<div className="container">
|
|
|
|
<div className="nav-main">
|
|
|
|
<div className="wrap">
|
2016-02-11 14:16:34 +00:00
|
|
|
<a className="nav-home" href="">
|
|
|
|
<img src="img/header_logo.png" />
|
2015-02-12 04:26:43 +00:00
|
|
|
React Native
|
|
|
|
</a>
|
2016-02-12 19:57:01 +00:00
|
|
|
<a className="nav-version" href="/react-native/versions.html">
|
|
|
|
{version}
|
|
|
|
</a>
|
2015-02-12 04:26:43 +00:00
|
|
|
<HeaderLinks section={this.props.section} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{this.props.children}
|
|
|
|
|
2016-09-24 20:48:54 +00:00
|
|
|
<footer className="nav-footer">
|
2016-09-24 02:56:31 +00:00
|
|
|
<section className="sitemap">
|
|
|
|
<a href="/react-native" className="nav-home">
|
|
|
|
<img src="img/header_logo.png" alt="React Native" width="66" height="58" />
|
|
|
|
</a>
|
|
|
|
<div>
|
|
|
|
<h5><a href="docs/">Docs</a></h5>
|
|
|
|
<a href="docs/getting-started.html">Getting Started</a>
|
|
|
|
<a href="docs/tutorial.html">Tutorial</a>
|
|
|
|
<a href="docs/integration-with-existing-apps.html">Integration With Existing Apps</a>
|
|
|
|
<a href="docs/more-resources.html">More Resources</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
2016-11-02 12:31:52 +00:00
|
|
|
<h5><a href="/react-native/support.html">Community</a></h5>
|
2016-09-24 02:56:31 +00:00
|
|
|
<a href="/react-native/showcase.html">Showcase</a>
|
|
|
|
<a href="http://www.meetup.com/topics/react-native/" target="_blank">Upcoming Events</a>
|
|
|
|
<a href="https://www.facebook.com/groups/react.native.community" target="_blank">Facebook Group</a>
|
|
|
|
<a href="https://twitter.com/reactnative" target="_blank">Twitter</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h5><a href="/react-native/support.html">Help</a></h5>
|
|
|
|
<a href="http://stackoverflow.com/questions/tagged/react-native" target="_blank">Stack Overflow</a>
|
|
|
|
<a href="https://discord.gg/0ZcbPKXt5bZjGY5n">Reactiflux Chat</a>
|
|
|
|
<a href="/react-native/versions.html" target="_blank">Latest Releases</a>
|
|
|
|
<a href="https://productpains.com/product/react-native/" target="_blank">Feature Requests</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h5>More</h5>
|
|
|
|
<a href="/react-native/blog">Blog</a>
|
|
|
|
<a href="https://github.com/facebook/react-native" target="_blank">GitHub</a>
|
|
|
|
<a href="http://facebook.github.io/react/" target="_blank">React</a>
|
|
|
|
</div>
|
|
|
|
</section>
|
2016-11-02 12:31:52 +00:00
|
|
|
<section className="newsletter">
|
|
|
|
<div id="mc_embed_signup">
|
2016-11-09 21:52:51 +00:00
|
|
|
<form action="//reactnative.us10.list-manage.com/subscribe/post?u=db0dd948e2b729ee62625b1a8&id=47cd41008f" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" className="validate" target="_blank" noValidate>
|
2016-11-02 12:31:52 +00:00
|
|
|
<div id="mc_embed_signup_scroll">
|
2016-11-26 03:09:20 +00:00
|
|
|
<label htmlFor="mce-EMAIL">
|
2016-11-02 12:31:52 +00:00
|
|
|
<h5>Get the React Native Newsletter</h5>
|
|
|
|
</label>
|
2016-11-21 01:49:21 +00:00
|
|
|
<input type="email" value="" name="EMAIL" className="email" id="mce-EMAIL" placeholder="email address" required />
|
|
|
|
<div style={{position: 'absolute', left: '-5000px'}} aria-hidden="true">
|
2016-11-09 21:52:51 +00:00
|
|
|
<input type="text" name="b_db0dd948e2b729ee62625b1a8_47cd41008f" tabIndex="-1" value="" />
|
2016-11-02 12:31:52 +00:00
|
|
|
</div>
|
|
|
|
<div className="clear">
|
|
|
|
<input type="submit" value="Sign up" name="subscribe" id="mc-embedded-subscribe" className="button" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
2016-09-24 02:56:31 +00:00
|
|
|
<a href="https://code.facebook.com/projects/" target="_blank" className="fbOpenSource">
|
|
|
|
<img src="img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/>
|
|
|
|
</a>
|
|
|
|
<section className="copyright">
|
|
|
|
Copyright © {currentYear} Facebook Inc.
|
|
|
|
</section>
|
2015-02-12 04:26:43 +00:00
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="fb-root" />
|
2016-11-21 01:49:21 +00:00
|
|
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js" />
|
2015-02-12 04:26:43 +00:00
|
|
|
<script dangerouslySetInnerHTML={{__html: `
|
|
|
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
|
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
|
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
|
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
2015-02-12 19:52:23 +00:00
|
|
|
ga('create', 'UA-41298772-2', 'facebook.github.io');
|
2015-02-12 04:26:43 +00:00
|
|
|
ga('send', 'pageview');
|
|
|
|
|
|
|
|
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)
|
|
|
|
){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";
|
|
|
|
fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
|
2016-03-09 21:57:54 +00:00
|
|
|
|
|
|
|
docsearch({
|
|
|
|
apiKey: '2c98749b4a1e588efec53b2acec13025',
|
|
|
|
indexName: 'react-native-versions',
|
|
|
|
inputSelector: '#algolia-doc-search',
|
2016-03-10 03:35:37 +00:00
|
|
|
algoliaOptions: { facetFilters: [ "tags:${algoliaVersion}" ], hitsPerPage: 5 }
|
2016-03-09 21:57:54 +00:00
|
|
|
});
|
2015-02-12 04:26:43 +00:00
|
|
|
`}} />
|
2016-02-11 14:16:34 +00:00
|
|
|
<script src="js/scripts.js" />
|
2016-11-02 12:31:52 +00:00
|
|
|
{/* Mailchimp Inline form-submission script for the React Native newsletter sign up form */}
|
2016-11-21 01:49:21 +00:00
|
|
|
<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js" />
|
|
|
|
<script type="text/javascript" dangerouslySetInnerHTML={{__html: "(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';}(jQuery));var $mcj = jQuery.noConflict(true);"}} />
|
2015-02-12 04:26:43 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = Site;
|