2018-01-30 11:53:12 -05:00
|
|
|
const bindAll = require('lodash.bindall');
|
|
|
|
const FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage;
|
|
|
|
const FormattedMessage = require('react-intl').FormattedMessage;
|
|
|
|
const injectIntl = require('react-intl').injectIntl;
|
|
|
|
const intlShape = require('react-intl').intlShape;
|
|
|
|
const React = require('react');
|
2017-06-21 16:20:18 -04:00
|
|
|
|
2018-01-30 11:53:12 -05:00
|
|
|
const Button = require('../../components/forms/button.jsx');
|
|
|
|
const FlexRow = require('../../components/flex-row/flex-row.jsx');
|
|
|
|
const MasonryGrid = require('../../components/masonrygrid/masonrygrid.jsx');
|
|
|
|
const TitleBanner = require('../../components/title-banner/title-banner.jsx');
|
|
|
|
const TTTModal = require('../../components/modal/ttt/modal.jsx');
|
|
|
|
const TTTTile = require('../../components/ttt-tile/ttt-tile.jsx');
|
|
|
|
|
|
|
|
const Page = require('../../components/page/www/page.jsx');
|
|
|
|
const render = require('../../lib/render.jsx');
|
|
|
|
|
|
|
|
const Tiles = require('./ttt.json');
|
2017-06-21 16:20:18 -04:00
|
|
|
|
|
|
|
require('./tips.scss');
|
|
|
|
|
2018-01-30 11:53:12 -05:00
|
|
|
class Tips extends React.Component {
|
|
|
|
constructor (props) {
|
|
|
|
super(props);
|
|
|
|
bindAll(this, [
|
|
|
|
'handleShowTTTModal',
|
|
|
|
'handleHideTTTModal',
|
|
|
|
'renderTTTTiles'
|
|
|
|
]);
|
|
|
|
this.state = {
|
|
|
|
currentTile: Tiles[0],
|
|
|
|
TTTModalOpen: false
|
|
|
|
};
|
|
|
|
}
|
|
|
|
handleShowTTTModal (tile) {
|
2017-06-21 16:20:18 -04:00
|
|
|
// expects translated tile
|
2018-01-30 11:53:12 -05:00
|
|
|
this.setState({
|
|
|
|
currentTile: tile,
|
|
|
|
TTTModalOpen: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
handleHideTTTModal () {
|
|
|
|
this.setState({
|
|
|
|
TTTModalOpen: false
|
|
|
|
});
|
|
|
|
}
|
|
|
|
renderTTTTiles () {
|
2017-06-21 16:20:18 -04:00
|
|
|
|
2018-01-30 11:53:12 -05:00
|
|
|
return Tiles.map((tile, key) => {
|
|
|
|
const translatedTile = {
|
|
|
|
activityLoc: this.props.intl.formatMessage({id: tile.activityLoc}),
|
|
|
|
bannerUrl: tile.bannerUrl,
|
|
|
|
description: this.props.intl.formatMessage({id: tile.description}),
|
|
|
|
guideLoc: this.props.intl.formatMessage({id: tile.guideLoc}),
|
2017-06-21 16:20:18 -04:00
|
|
|
thumbUrl: tile.thumbUrl,
|
2018-01-30 11:53:12 -05:00
|
|
|
title: this.props.intl.formatMessage({id: tile.title}),
|
|
|
|
tutorialLoc: tile.tutorialLoc
|
2017-06-21 16:20:18 -04:00
|
|
|
};
|
2018-01-30 11:53:12 -05:00
|
|
|
return (
|
|
|
|
<TTTTile
|
|
|
|
key={key}
|
|
|
|
onGuideClick={() => { // eslint-disable-line react/jsx-no-bind
|
|
|
|
this.handleShowTTTModal(translatedTile);
|
|
|
|
}}
|
|
|
|
{...translatedTile}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
render () {
|
2017-06-21 16:20:18 -04:00
|
|
|
return (
|
|
|
|
<div className="tips">
|
|
|
|
<TitleBanner className="masthead mod-blue-bg">
|
|
|
|
<h1 className="title-banner-h1">
|
2018-01-30 11:53:12 -05:00
|
|
|
<FormattedMessage id="tips.title" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</h1>
|
|
|
|
<p className="intro title-banner-p">
|
|
|
|
<FormattedHTMLMessage
|
|
|
|
id="tips.subTitle"
|
|
|
|
values={{
|
2018-01-30 11:53:12 -05:00
|
|
|
GettingStartedPDF: this.props.intl.formatMessage({
|
|
|
|
id: 'guides.Getting-Started-Guide-Scratch2Link'
|
|
|
|
})
|
2017-06-21 16:20:18 -04:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</p>
|
|
|
|
<p className="title-banner-p">
|
|
|
|
<a href="/projects/editor/?tip_bar=getStarted">
|
|
|
|
<Button className="tips-button getting-started-button">
|
2018-01-30 11:53:12 -05:00
|
|
|
<img src="/images/tips/blocks-icon.svg" />
|
|
|
|
<FormattedMessage id="tips.tryGettingStarted" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</Button>
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</TitleBanner>
|
|
|
|
<div className="inner">
|
|
|
|
<section className="ttt-section">
|
|
|
|
<div className="ttt-head">
|
|
|
|
<h2>
|
2018-01-30 11:53:12 -05:00
|
|
|
<FormattedMessage id="tips.tttHeader" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</h2>
|
|
|
|
<p>
|
2018-01-30 11:53:12 -05:00
|
|
|
<FormattedHTMLMessage id="tips.tttBody" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<MasonryGrid >
|
|
|
|
{this.renderTTTTiles()}
|
|
|
|
</MasonryGrid>
|
|
|
|
<TTTModal
|
|
|
|
isOpen={this.state.TTTModalOpen}
|
2018-01-30 11:53:12 -05:00
|
|
|
onRequestClose={this.handleHideTTTModal}
|
|
|
|
{...this.state.currentTile}
|
|
|
|
/>
|
2017-06-21 16:20:18 -04:00
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
<div className="tips-resources">
|
|
|
|
<div className="inner">
|
2018-01-30 11:53:12 -05:00
|
|
|
<FlexRow
|
|
|
|
as="section"
|
|
|
|
className="tips-info-section cards-info"
|
|
|
|
>
|
2017-06-21 16:20:18 -04:00
|
|
|
<div className="tips-info-body">
|
|
|
|
<h2>
|
2018-01-30 11:53:12 -05:00
|
|
|
<FormattedMessage id="tips.cardsHeader" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</h2>
|
|
|
|
<p>
|
2018-01-30 11:53:12 -05:00
|
|
|
<FormattedHTMLMessage id="tips.cardsBody" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</p>
|
2017-06-27 16:27:07 -04:00
|
|
|
<p className="tips-cards-buttons">
|
2018-01-30 11:53:12 -05:00
|
|
|
<a
|
|
|
|
href={this.props.intl.formatMessage({
|
|
|
|
id: 'cards.ScratchCardsAllLink'
|
|
|
|
})}
|
|
|
|
>
|
2017-06-21 16:20:18 -04:00
|
|
|
<Button className="tips-button">
|
2018-01-30 11:53:12 -05:00
|
|
|
<FormattedMessage id="tips.cardsDownload" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</Button>
|
|
|
|
</a>
|
|
|
|
<a
|
2017-07-13 12:48:18 -04:00
|
|
|
href="https://scratch-foundation.myshopify.com/collections/all-products/products/scratch-coding-cards-creative-coding-activities-for-kids"
|
2018-01-30 11:53:12 -05:00
|
|
|
rel="noopener noreferrer"
|
|
|
|
target="_blank"
|
|
|
|
>
|
2017-06-21 16:20:18 -04:00
|
|
|
<Button className="tips-button purchase-button">
|
2018-01-30 11:53:12 -05:00
|
|
|
<FormattedMessage id="tips.cardsPurchase" />
|
|
|
|
<img src="/images/tips/arrow-icon.svg" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</Button>
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div className="tips-info-body tips-illustration">
|
2018-01-30 11:53:12 -05:00
|
|
|
<img src="/images/tips/cards-illustration.svg" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</div>
|
|
|
|
</FlexRow>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="inner">
|
2018-01-30 11:53:12 -05:00
|
|
|
<div className="tips-divider" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</div>
|
|
|
|
<div className="tips-resources">
|
|
|
|
<div className="inner">
|
2018-01-30 11:53:12 -05:00
|
|
|
<FlexRow
|
|
|
|
as="section"
|
|
|
|
className="tips-info-section"
|
|
|
|
>
|
2017-06-21 16:20:18 -04:00
|
|
|
<div className="tips-info-body tips-illustration">
|
2018-01-30 11:53:12 -05:00
|
|
|
<img
|
|
|
|
className="mod-flow-left"
|
|
|
|
src="/images/tips/project-illustration.svg"
|
|
|
|
/>
|
2017-06-21 16:20:18 -04:00
|
|
|
</div>
|
|
|
|
<div className="tips-info-body">
|
|
|
|
<h2>
|
2018-01-30 11:53:12 -05:00
|
|
|
<FormattedMessage id="tips.starterProjectsHeader" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</h2>
|
|
|
|
<p>
|
2018-01-30 11:53:12 -05:00
|
|
|
<FormattedHTMLMessage id="tips.starterProjectsBody" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<a href="/starter_projects">
|
|
|
|
<Button className="tips-button">
|
2018-01-30 11:53:12 -05:00
|
|
|
<FormattedMessage id="tips.starterProjectsPlay" />
|
2017-06-21 16:20:18 -04:00
|
|
|
</Button>
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</FlexRow>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="inner">
|
2018-01-30 11:53:12 -05:00
|
|
|
<FlexRow
|
|
|
|
as="section"
|
|
|
|
className="tips-info-section mod-align-top"
|
|
|
|
>
|
|
|
|
<div className="tips-info-body mod-narrow">
|
|
|
|
<img
|
|
|
|
className="tips-icon"
|
|
|
|
src="/images/tips/download-icon.svg"
|
|
|
|
/>
|
|
|
|
<h3>
|
|
|
|
<FormattedMessage id="tips.offlineEditorHeader" />
|
|
|
|
</h3>
|
|
|
|
<p>
|
|
|
|
<FormattedHTMLMessage id="tips.offlineEditorBody" />
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div className="tips-info-body mod-narrow">
|
|
|
|
<img
|
|
|
|
className="tips-icon"
|
|
|
|
src="/images/tips/question-icon.svg"
|
|
|
|
/>
|
|
|
|
<h3>
|
|
|
|
<FormattedMessage id="tips.questionsHeader" />
|
|
|
|
</h3>
|
|
|
|
<p>
|
|
|
|
<FormattedHTMLMessage id="tips.questionsBody" />
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</FlexRow>
|
2017-06-21 16:20:18 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2018-01-30 11:53:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
Tips.propTypes = {
|
|
|
|
intl: intlShape
|
|
|
|
};
|
|
|
|
|
|
|
|
const WrappedTips = injectIntl(Tips);
|
2017-06-21 16:20:18 -04:00
|
|
|
|
|
|
|
render(
|
2018-01-30 11:53:12 -05:00
|
|
|
<Page><WrappedTips /></Page>, document.getElementById('app'));
|