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 DocsLayout
|
|
|
|
*/
|
|
|
|
|
2016-01-31 07:01:14 +00:00
|
|
|
var DocsSidebar = require('DocsSidebar');
|
2016-08-04 00:37:13 +00:00
|
|
|
var Header = require('Header');
|
|
|
|
var Footer = require('Footer');
|
2016-01-31 07:01:14 +00:00
|
|
|
var Marked = require('Marked');
|
2015-02-12 04:26:43 +00:00
|
|
|
var React = require('React');
|
|
|
|
var Site = require('Site');
|
2016-05-07 15:35:11 +00:00
|
|
|
var Metadata = require('Metadata');
|
2016-01-31 07:01:14 +00:00
|
|
|
|
2015-02-12 04:26:43 +00:00
|
|
|
var DocsLayout = React.createClass({
|
2016-02-29 17:20:24 +00:00
|
|
|
childContextTypes: {
|
2016-05-07 15:35:11 +00:00
|
|
|
permalink: React.PropTypes.string,
|
|
|
|
version: React.PropTypes.string
|
2016-02-29 17:20:24 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
getChildContext: function() {
|
2016-05-07 15:35:11 +00:00
|
|
|
return {
|
|
|
|
permalink: this.props.metadata.permalink,
|
|
|
|
version: Metadata.config.RN_VERSION || 'next'
|
|
|
|
};
|
2016-02-29 17:20:24 +00:00
|
|
|
},
|
|
|
|
|
2015-02-12 04:26:43 +00:00
|
|
|
render: function() {
|
|
|
|
var metadata = this.props.metadata;
|
|
|
|
var content = this.props.children;
|
|
|
|
return (
|
2016-08-30 06:08:50 +00:00
|
|
|
<Site
|
|
|
|
section="docs"
|
|
|
|
title={metadata.title}
|
|
|
|
description={content.trim().split('\n')[0]} >
|
2015-02-12 04:26:43 +00:00
|
|
|
<section className="content wrap documentationContent">
|
|
|
|
<DocsSidebar metadata={metadata} />
|
|
|
|
<div className="inner-content">
|
|
|
|
<a id="content" />
|
2016-08-04 00:37:13 +00:00
|
|
|
<Header level={1}>{metadata.title}</Header>
|
2015-02-12 04:26:43 +00:00
|
|
|
<Marked>{content}</Marked>
|
|
|
|
<div className="docs-prevnext">
|
2016-02-17 15:30:04 +00:00
|
|
|
{metadata.previous && <a className="docs-prev" href={'docs/' + metadata.previous + '.html#content'}>← Prev</a>}
|
|
|
|
{metadata.next && <a className="docs-next" href={'docs/' + metadata.next + '.html#content'}>Next →</a>}
|
2015-02-12 04:26:43 +00:00
|
|
|
</div>
|
2016-08-04 00:37:13 +00:00
|
|
|
<Footer path={'docs/' + metadata.filename} />
|
2016-07-04 17:51:34 +00:00
|
|
|
<div className="survey">
|
|
|
|
<div className="survey-image" />
|
|
|
|
<p>
|
|
|
|
Recently, we have been working hard to make the documentation better based on your feedback. Your responses to this yes/no style survey will help us gauge whether we moved in the right direction with the improvements. Thank you!
|
|
|
|
</p>
|
|
|
|
<center>
|
|
|
|
<a className="button" href="https://www.facebook.com/survey?oid=516954245168428">Take Survey</a>
|
|
|
|
</center>
|
|
|
|
</div>
|
2015-02-12 04:26:43 +00:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</Site>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = DocsLayout;
|