Add RegistrationForm UI component and new Registration wire component

Hook it up to MatrixChat instead of the existing logic (this breaks reg). WIP.
This commit is contained in:
Kegan Dougal 2015-11-17 17:40:31 +00:00
parent 8602e0665d
commit 8e8b27c893
3 changed files with 290 additions and 3 deletions

View file

@ -23,7 +23,10 @@ var MatrixChatController = require('matrix-react-sdk/lib/controllers/pages/Matri
var dis = require('matrix-react-sdk/lib/dispatcher');
var Matrix = require("matrix-js-sdk");
var ContextualMenu = require("../../../../ContextualMenu");
var ContextualMenu = require("../../../../ContextualMenu")
var Login = require("../../../../components/login/Login");
var Registration = require("../../../../components/login/Registration");
var Signup = require("matrix-react-sdk/lib/Signup");
module.exports = React.createClass({
displayName: 'MatrixChat',
@ -93,12 +96,15 @@ module.exports = React.createClass({
this.showScreen("register");
},
onLoginClick: function() {
this.showScreen("login");
},
render: function() {
var LeftPanel = sdk.getComponent('organisms.LeftPanel');
var RoomView = sdk.getComponent('organisms.RoomView');
var RightPanel = sdk.getComponent('organisms.RightPanel');
var UserSettings = sdk.getComponent('organisms.UserSettings');
var Register = sdk.getComponent('templates.Register');
var CreateRoom = sdk.getComponent('organisms.CreateRoom');
var RoomDirectory = sdk.getComponent('organisms.RoomDirectory');
var MatrixToolbar = sdk.getComponent('molecules.MatrixToolbar');
@ -159,15 +165,23 @@ module.exports = React.createClass({
<Spinner />
);
} else if (this.state.screen == 'register') {
/*
return (
<Register onLoggedIn={this.onLoggedIn} clientSecret={this.state.register_client_secret}
sessionId={this.state.register_session_id} idSid={this.state.register_id_sid}
hsUrl={this.state.register_hs_url} isUrl={this.state.register_is_url}
registrationUrl={this.props.registrationUrl}
/>
); */
return (
<Registration
onLoggedIn={this.onLoggedIn}
onLoginClick={this.onLoginClick}
registerLogic={new Signup.Register(
"foo", "bar"
)} />
);
} else {
var Login = require("../../../../components/login/Login");
return (
<Login onLoggedIn={this.onLoggedIn} onRegisterClick={this.onRegisterClick} />
);