react-native/website/layout/DocsLayout.js
Joel Marcey b48d112f26 Add post documentation lockdown survey link
Summary:
We did a survey prior to the doc lockdown to get an idea of what we should focus on. Now we have a yes/no style survey to ensure that we met the user needs when it came to our start of improving the docs.

This diff adds the survey link to the bottom of each page. And we will cherry-pick it into 0.29 as well, which will be the first official release with the new doc content

> **NOTE**: The content via the links in this survey will not be valid until 0.29 is actually released. So I have not enabled the questions for the survey until then.

**Test Plan:**

http://localhost:8079/react-native/docs/getting-started.html

<img width="753" alt="screenshot 2016-07-01 17 35 17" src="https://cloud.githubusercontent.com/assets/3757713/16535354/987dd3a8-3fb4-11e6-81b7-1a1fcffd3bb2.png">
Closes https://github.com/facebook/react-native/pull/8530

Differential Revision: D3515242

Pulled By: JoelMarcey

fbshipit-source-id: c2d241d472853dfb3f9e7d3ae9560b318aacb866
2016-07-04 10:58:25 -07:00

68 lines
2.3 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 DocsLayout
*/
var DocsSidebar = require('DocsSidebar');
var HeaderWithGithub = require('HeaderWithGithub');
var Marked = require('Marked');
var React = require('React');
var Site = require('Site');
var Metadata = require('Metadata');
var DocsLayout = React.createClass({
childContextTypes: {
permalink: React.PropTypes.string,
version: React.PropTypes.string
},
getChildContext: function() {
return {
permalink: this.props.metadata.permalink,
version: Metadata.config.RN_VERSION || 'next'
};
},
render: function() {
var metadata = this.props.metadata;
var content = this.props.children;
return (
<Site section="docs" title={metadata.title}>
<section className="content wrap documentationContent">
<DocsSidebar metadata={metadata} />
<div className="inner-content">
<a id="content" />
<HeaderWithGithub
title={metadata.title}
level={1}
path={'docs/' + metadata.filename}
/>
<Marked>{content}</Marked>
<div className="docs-prevnext">
{metadata.previous && <a className="docs-prev" href={'docs/' + metadata.previous + '.html#content'}>&larr; Prev</a>}
{metadata.next && <a className="docs-next" href={'docs/' + metadata.next + '.html#content'}>Next &rarr;</a>}
</div>
<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>
</div>
</section>
</Site>
);
}
});
module.exports = DocsLayout;