2015-06-19 07:53:48 -04:00
|
|
|
var React = require('react');
|
2015-06-23 09:40:50 -04:00
|
|
|
var ComponentBroker = require('../../../../src/ComponentBroker');
|
2015-06-19 07:53:48 -04:00
|
|
|
|
|
|
|
var RoomList = ComponentBroker.get('organisms/RoomList');
|
|
|
|
var RoomView = ComponentBroker.get('organisms/RoomView');
|
|
|
|
var MatrixToolbar = ComponentBroker.get('molecules/MatrixToolbar');
|
|
|
|
var Login = ComponentBroker.get('templates/Login');
|
|
|
|
|
2015-06-23 09:40:50 -04:00
|
|
|
var MatrixChatController = require("../../../../src/controllers/pages/MatrixChat");
|
2015-06-19 07:53:48 -04:00
|
|
|
|
|
|
|
// should be atomised
|
|
|
|
var Loader = require("react-loader");
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = React.createClass({
|
2015-06-19 11:21:09 -04:00
|
|
|
displayName: 'MatrixChat',
|
2015-06-19 07:53:48 -04:00
|
|
|
mixins: [MatrixChatController],
|
|
|
|
|
|
|
|
render: function() {
|
|
|
|
if (this.state.logged_in && this.state.ready) {
|
|
|
|
return (
|
|
|
|
<div className="mx_MatrixChat">
|
|
|
|
<div className="mx_MatrixChat_leftPanel">
|
|
|
|
<MatrixToolbar />
|
|
|
|
<RoomList selectedRoom={this.state.currentRoom} />
|
|
|
|
</div>
|
|
|
|
<RoomView roomId={this.state.currentRoom} key={this.state.currentRoom} />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
} else if (this.state.logged_in) {
|
|
|
|
return (
|
|
|
|
<Loader />
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (
|
|
|
|
<Login onLoggedIn={this.onLoggedIn} />
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|