2015-06-19 11:53:48 +00:00
|
|
|
var React = require('react');
|
|
|
|
|
|
|
|
var ComponentBroker = require('../../ComponentBroker');
|
|
|
|
|
|
|
|
var MessageTile = ComponentBroker.get('molecules/MessageTile');
|
|
|
|
var RoomHeader = ComponentBroker.get('molecules/RoomHeader');
|
2015-06-22 10:42:09 +00:00
|
|
|
var MemberList = ComponentBroker.get('organisms/MemberList');
|
2015-06-19 11:53:48 +00:00
|
|
|
var MessageComposer = ComponentBroker.get('molecules/MessageComposer');
|
|
|
|
|
|
|
|
var RoomViewController = require("../../controllers/organisms/RoomView");
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = React.createClass({
|
2015-06-19 15:21:09 +00:00
|
|
|
displayName: 'RoomView',
|
2015-06-19 11:53:48 +00: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 10:42:09 +00: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 11:53:48 +00:00
|
|
|
<MessageComposer roomId={this.props.roomId} />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|