mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-16 02:11:30 +03:00
33 lines
724 B
JavaScript
33 lines
724 B
JavaScript
|
var React = require('react');
|
||
|
|
||
|
var MatrixClientPeg = require("../MatrixClientPeg");
|
||
|
|
||
|
var RoomTile = require("../molecules/RoomTile");
|
||
|
|
||
|
module.exports = React.createClass({
|
||
|
componentWillMount: function() {
|
||
|
var cli = MatrixClientPeg.get();
|
||
|
|
||
|
this.setState({roomList: cli.getRooms()});
|
||
|
},
|
||
|
|
||
|
makeRoomTiles: function() {
|
||
|
return this.state.roomList.map(function(room) {
|
||
|
return (
|
||
|
<RoomTile room={room} key={room.roomId} />
|
||
|
);
|
||
|
});
|
||
|
},
|
||
|
|
||
|
render: function() {
|
||
|
return (
|
||
|
<div className="mx_RoomList">
|
||
|
<ul>
|
||
|
{this.makeRoomTiles()}
|
||
|
</ul>
|
||
|
</div>
|
||
|
);
|
||
|
}
|
||
|
});
|
||
|
|