Basic structure of a react SDK and start of an implementation.

This commit is contained in:
David Baker
2015-06-09 17:40:42 +01:00
commit c42733ec95
15 changed files with 407 additions and 0 deletions

38
src/templates/Login.js Normal file
View File

@@ -0,0 +1,38 @@
var React = require('react');
var MatrixClientPeg = require("../MatrixClientPeg");
var HomeServerTextBox = require("../molecules/HomeServerTextBox");
var Loader = require("react-loader");
module.exports = React.createClass({
getInitialState: function() {
return {
step: 'choose_hs'
};
},
setStep: function(step) {
this.setState({ step: step });
},
onHSChosen: function(ev) {
this.setStep("fetch_stages");
},
render: function() {
switch (this.state.step) {
case 'choose_hs':
return (
<div>
<div>Please log in:</div>
<HomeServerTextBox />
<button onClick={this.onHSChosen}>Continue</button>
</div>
);
case 'fetch_stages':
return (
<Loader />
);
}
}
});