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-11-21 01:49:21 +00:00
|
|
|
'use strict';
|
2015-02-12 04:26:43 +00:00
|
|
|
|
2016-01-31 07:01:14 +00:00
|
|
|
var DocsSidebar = require('DocsSidebar');
|
2016-08-04 00:37:13 +00:00
|
|
|
var Footer = require('Footer');
|
2016-11-21 01:49:21 +00:00
|
|
|
var Header = require('Header');
|
2016-01-31 07:01:14 +00:00
|
|
|
var Marked = require('Marked');
|
2016-11-21 01:49:21 +00:00
|
|
|
var Metadata = require('Metadata');
|
2015-02-12 04:26:43 +00:00
|
|
|
var React = require('React');
|
2017-04-12 23:09:48 +00:00
|
|
|
var PropTypes = require('prop-types');
|
2015-02-12 04:26:43 +00:00
|
|
|
var Site = require('Site');
|
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: {
|
2017-04-12 23:09:48 +00:00
|
|
|
permalink: PropTypes.string,
|
|
|
|
version: 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"
|
2016-08-30 17:56:48 +00:00
|
|
|
title={metadata.title} >
|
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} />
|
2015-02-12 04:26:43 +00:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</Site>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = DocsLayout;
|