2015-06-19 13:53:48 +02:00
|
|
|
var React = require('react');
|
2015-06-23 15:40:50 +02:00
|
|
|
var ComponentBroker = require('../../../../src/ComponentBroker');
|
2015-06-19 13:53:48 +02: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 15:40:50 +02:00
|
|
|
var MatrixChatController = require("../../../../src/controllers/pages/MatrixChat");
|
2015-06-19 13:53:48 +02:00
|
|
|
|
|
|
|
// should be atomised
|
|
|
|
var Loader = require("react-loader");
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = React.createClass({
|
2015-06-19 17:21:09 +02:00
|
|
|
displayName: 'MatrixChat',
|
2015-06-19 13:53:48 +02: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} />
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|