Skip to content

Instantly share code, notes, and snippets.

@jineeshjohn
Last active September 19, 2016 21:30
Show Gist options
  • Save jineeshjohn/27c806d6078a751e0e0c08ef9673a7f0 to your computer and use it in GitHub Desktop.
Save jineeshjohn/27c806d6078a751e0e0c08ef9673a7f0 to your computer and use it in GitHub Desktop.
define(function(require){
'use strict';
var React = require('react');
var store = require('./store');
var RegisterForm = require('es6!./registerForm');
var VerifyForm = require('es6!./verifyForm');
var RegisterSuccess = require('es6!./registerSuccess');
var Stepper = require('es6!./stepper');
var CommonContainer = React.createClass({
getInitialState: function(){
return {
username: 'Lalu',
page: 0,
PageList:[RegisterForm,VerifyForm,RegisterSuccess]
};
},
nextPage: function(){
this.setState({page: this.state.page + 1});
},
previousPage: function() {
this.setState({page: this.state.page - 1});
},
changeUserName: function(e){
this.setState({username: e.target.value});
},
render: function() {
var CurrentPage = this.state.PageList[this.state.page];
return(
<div className='common-container'>
<CurrentPage
username={this.state.username}
changeUserName={this.changeUserName}
/>
<Stepper
nextPage={this.nextPage}
page={this.state.page}
previousPage={this.previousPage}
/>
</div>
);
}
});
return CommonContainer;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment