Unverified Commit 797afb6d authored by Matthew Taylor's avatar Matthew Taylor Committed by GitHub

Merge pull request #1761 from mewtaylor/issue/gh-1711

Implement GH-1711: Add 3.0 preview faq page
parents 53acea21 c7d4a708
...@@ -191,6 +191,13 @@ ...@@ -191,6 +191,13 @@
"view": "microworldshomepage/microworldshomepage", "view": "microworldshomepage/microworldshomepage",
"title": "Microworlds" "title": "Microworlds"
}, },
{
"name": "preview-faq",
"pattern": "^/preview-faq/?$",
"routeAlias": "/preview-faq/?$",
"view": "preview-faq/preview-faq",
"title": "Scratch 3.0 Preview FAQ"
},
{ {
"name": "privacypolicy", "name": "privacypolicy",
"pattern": "^/privacy_policy/?$", "pattern": "^/privacy_policy/?$",
......
{
"preview-faq.title": "Scratch 3.0 Preview FAQ"
}
var cheerio = require('cheerio');
var injectIntl = require('react-intl').injectIntl;
var React = require('react');
var xhr = require('xhr');
var InformationPage = require('../../components/informationpage/informationpage.jsx');
var Page = require('../../components/page/www/page.jsx');
var render = require('../../lib/render.jsx');
require('./preview-faq.scss');
var PreviewFaq = injectIntl(React.createClass({
type: 'PreviewFaq',
getInitialState: function () {
return {
faqDoc: {__html: ''}
};
},
componentDidMount: function () {
xhr({
method: 'GET',
uri: 'https://docs.google.com/document/d/e/2PACX-1vQZFrpOagYqEwcrBBCplIomiyguPAodIJVnCq9Sr11WDI_aa2b-JtDWak-Aiu-cwWobTXftRMF6wBbd/pub?embedded=true'
}, function (error, response, body) {
var $ = cheerio.load(body);
this.setState({faqDoc: {__html: $('html').html()}});
}.bind(this));
},
render: function () {
return (
<InformationPage title={this.props.intl.formatMessage({id: 'preview-faq.title'})}>
<div className="inner">
<div
className="preview-faq"
dangerouslySetInnerHTML={this.state.faqDoc}
/>
</div>
</InformationPage>
);
}
}));
render(<Page><PreviewFaq /></Page>, document.getElementById('app'));
#view {
padding: 0;
}
.preview-faq {
margin-bottom: 5rem;
}
.title-banner-h1 {
line-height: 1.7em !important;
font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif !important;
font-size: 2.5rem !important;
font-weight: 900 !important;
}
.preview-faq li {
margin: 0 2rem !important;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment