Commit 237e6637 authored by Matthew Taylor's avatar Matthew Taylor

Add registration component to `JOIN SCRATCH`

fixes #122
parent be6358fb
...@@ -5,6 +5,7 @@ var FormattedMessage = ReactIntl.FormattedMessage; ...@@ -5,6 +5,7 @@ var FormattedMessage = ReactIntl.FormattedMessage;
var FormattedHTMLMessage = ReactIntl.FormattedHTMLMessage; var FormattedHTMLMessage = ReactIntl.FormattedHTMLMessage;
var Modal = require('../modal/modal.jsx'); var Modal = require('../modal/modal.jsx');
var Registration = require('../registration/registration.jsx');
require('./intro.scss'); require('./intro.scss');
...@@ -31,6 +32,17 @@ var Intro = React.createClass({ ...@@ -31,6 +32,17 @@ var Intro = React.createClass({
closeVideo: function () { closeVideo: function () {
this.setState({videoOpen: false}); this.setState({videoOpen: false});
}, },
handleJoinClick: function (e) {
e.preventDefault();
this.setState({'registrationOpen': true});
},
closeRegistration: function () {
this.setState({'registrationOpen': false});
},
completeRegistration: function () {
window.refreshSession();
this.closeRegistration();
},
render: function () { render: function () {
var frameSettings = { var frameSettings = {
width: 570, width: 570,
...@@ -77,7 +89,7 @@ var Intro = React.createClass({ ...@@ -77,7 +89,7 @@ var Intro = React.createClass({
defaultMessage='SEE EXAMPLES' /> defaultMessage='SEE EXAMPLES' />
</div> </div>
</a> </a>
<a className="sprite sprite-3" href="#"> <a className="sprite sprite-3" href="#" onClick={this.handleJoinClick}>
<img <img
className="costume costume-1" className="costume costume-1"
src="//cdn.scratch.mit.edu/scratchr2/static/images/gobo-a.png" /> src="//cdn.scratch.mit.edu/scratchr2/static/images/gobo-a.png" />
...@@ -92,6 +104,10 @@ var Intro = React.createClass({ ...@@ -92,6 +104,10 @@ var Intro = React.createClass({
</div> </div>
<div className="text subtext">( it&rsquo;s free )</div> <div className="text subtext">( it&rsquo;s free )</div>
</a> </a>
<Registration key="registration"
isOpen={this.state.registrationOpen}
onRequestClose={this.closeRegistration}
onRegistrationDone={this.completeRegistration} />
</div> </div>
<div className="description"> <div className="description">
A creative learning community with A creative learning community with
......
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