2015-06-19 13:53:48 +02:00
|
|
|
var React = require('react');
|
|
|
|
|
|
|
|
var ComponentBroker = require('../../ComponentBroker');
|
|
|
|
|
|
|
|
var MessageTile = ComponentBroker.get('molecules/MessageTile');
|
|
|
|
var RoomHeader = ComponentBroker.get('molecules/RoomHeader');
|
2015-06-22 12:42:09 +02:00
|
|
|
var MemberList = ComponentBroker.get('organisms/MemberList');
|
2015-06-19 13:53:48 +02:00
|
|
|
var MessageComposer = ComponentBroker.get('molecules/MessageComposer');
|
|
|
|
|
|
|
|
var RoomViewController = require("../../controllers/organisms/RoomView");
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = React.createClass({
|
2015-06-19 17:21:09 +02:00
|
|
|
displayName: 'RoomView',
|
2015-06-19 13:53:48 +02:00
|
|
|
mixins: [RoomViewController],
|
|
|
|
|
|
|
|
getMessageTiles: function() {
|
|
|
|
return this.state.room.timeline.map(function(mxEv) {
|
|
|
|
return (
|
|
|
|
<li key={mxEv.getId()}><MessageTile mxEvent={mxEv} /></li>
|
|
|
|
);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
render: function() {
|
|
|
|
return (
|
|
|
|
<div className="mx_RoomView">
|
|
|
|
<RoomHeader room={this.state.room} />
|
2015-06-22 12:42:09 +02:00
|
|
|
<div className="mx_RoomView_HSplit">
|
|
|
|
<ul className="mx_RoomView_MessageList" ref="messageList">
|
|
|
|
{this.getMessageTiles()}
|
|
|
|
</ul>
|
|
|
|
<MemberList roomId={this.props.roomId} key={this.props.roomId} />
|
|
|
|
</div>
|
2015-06-19 13:53:48 +02:00
|
|
|
<MessageComposer roomId={this.props.roomId} />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|