2015-06-09 19:40:42 +03:00
|
|
|
var React = require('react');
|
2015-06-12 19:34:17 +03:00
|
|
|
var MessageTile = require('../molecules/MessageTile');
|
|
|
|
var RoomHeader = require('../molecules/RoomHeader');
|
|
|
|
|
|
|
|
var MatrixClientPeg = require("../MatrixClientPeg");
|
2015-06-09 19:40:42 +03:00
|
|
|
|
|
|
|
module.exports = React.createClass({
|
|
|
|
getInitialState: function() {
|
|
|
|
return {
|
2015-06-12 19:34:17 +03:00
|
|
|
room: MatrixClientPeg.get().getRoom(this.props.room_id)
|
2015-06-09 19:40:42 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2015-06-12 19:34:17 +03:00
|
|
|
getMessageTiles: function() {
|
|
|
|
return this.state.room.timeline.map(function(mxEv) {
|
2015-06-09 19:40:42 +03:00
|
|
|
return (
|
2015-06-12 19:34:17 +03:00
|
|
|
<MessageTile mxEvent={mxEv} key={mxEv.getId()} />
|
2015-06-09 19:40:42 +03:00
|
|
|
);
|
2015-06-12 19:34:17 +03:00
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
render: function() {
|
2015-06-09 19:40:42 +03:00
|
|
|
return (
|
2015-06-12 19:34:17 +03:00
|
|
|
<div className="mx_RoomView">
|
|
|
|
<RoomHeader room={this.state.room} />
|
|
|
|
<ul>
|
|
|
|
{this.getMessageTiles()}
|
2015-06-09 19:40:42 +03:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|