const bindAll = require('lodash.bindall'); const connect = require('react-redux').connect; const PropTypes = require('prop-types'); const React = require('react'); const navigationActions = require('../../redux/navigation.js'); const Video = require('../video/video.jsx'); const FlexRow = require('../flex-row/flex-row.jsx'); const TitleBanner = require('../title-banner/title-banner.jsx'); require('./intro.scss'); class Intro extends React.Component { constructor (props) { super(props); bindAll(this, [ 'handleShowVideo' ]); this.state = { videoOpen: false }; } handleShowVideo () { this.setState({videoOpen: true}); } render () { return (

{this.props.messages['intro.tagLine1']}
{this.props.messages['intro.tagLine2']}

{this.props.messages['intro.startCreating']} {this.props.messages['intro.join']}
{this.state.videoOpen ? (
{this.props.messages['intro.aboutScratch']}
{this.props.messages['intro.forParents']}
{this.props.messages['intro.forEducators']}
); } } Intro.propTypes = { handleClickRegistration: PropTypes.func, messages: PropTypes.shape({ 'intro.aboutScratch': PropTypes.string, 'intro.forEducators': PropTypes.string, 'intro.forParents': PropTypes.string, 'intro.join': PropTypes.string, 'intro.startCreating': PropTypes.string, 'intro.tagLine1': PropTypes.string, 'intro.tagLine2': PropTypes.string, 'intro.watchVideo': PropTypes.string }) }; Intro.defaultProps = { messages: { 'intro.aboutScratch': 'About Scratch', 'intro.forEducators': 'For Educators', 'intro.forParents': 'For Parents', 'intro.join': 'Join', 'intro.startCreating': 'Start Creating', 'intro.tagLine1': 'Create stories, games, and animations', 'intro.tagLine2': 'Share with others around the world', 'intro.watchVideo': 'Watch Video' }, session: {} }; const mapStateToProps = state => ({ session: state.session }); const mapDispatchToProps = dispatch => ({ handleClickRegistration: event => { event.preventDefault(); dispatch(navigationActions.handleRegistrationRequested()); } }); const ConnectedIntro = connect( mapStateToProps, mapDispatchToProps )(Intro); module.exports = ConnectedIntro;