var React = require('react'); var injectIntl = require('react-intl').injectIntl; var FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage; var FormattedMessage = require('react-intl').FormattedMessage; var render = require('../../lib/render.jsx'); var MasonryGrid = require('../../components/masonrygrid/masonrygrid.jsx'); var Page = require('../../components/page/www/page.jsx'); var Button = require('../../components/forms/button.jsx'); var TitleBanner = require('../../components/title-banner/title-banner.jsx'); var FlexRow = require('../../components/flex-row/flex-row.jsx'); var TTTTile = require('../../components/ttt-tile/ttt-tile.jsx'); var TTTModal = require('../../components/modal/ttt/modal.jsx'); var Tiles = require('./ttt.json'); require('./tips.scss'); var Tips = injectIntl(React.createClass({ type: 'Tips', getInitialState: function () { return {currentTile: Tiles[0], TTTModalOpen: false}; }, showTTTModal: function (tile) { // expects translated tile this.setState({currentTile: tile, TTTModalOpen: true}); }, hideTTTModal: function () { this.setState({TTTModalOpen: false}); }, renderTTTTiles: function () { var formatMessage = this.props.intl.formatMessage; var translatedTile = {}; return Tiles.map(function (tile, key) { translatedTile = { title: formatMessage({id: tile.title}), description: formatMessage({id: tile.description}), tutorialLoc: tile.tutorialLoc, activityLoc: formatMessage({id: tile.activityLoc}), guideLoc: formatMessage({id: tile.guideLoc}), thumbUrl: tile.thumbUrl, bannerUrl: tile.bannerUrl }; return (); }, this); // don't forget to pass 'this' into map function }, render: function () { var formatMessage = this.props.intl.formatMessage; return (

{this.renderTTTTiles()}

); } })); render( , document.getElementById('app'));