2015-06-09 18:40:42 +02:00
|
|
|
var React = require('react');
|
2015-06-12 18:34:17 +02:00
|
|
|
var classNames = require('classnames');
|
|
|
|
|
2015-06-19 13:53:48 +02:00
|
|
|
var RoomTileController = require("../../controllers/molecules/RoomTile");
|
2015-06-09 18:40:42 +02:00
|
|
|
|
2015-06-22 15:48:58 +02:00
|
|
|
var MatrixClientPeg = require("../../MatrixClientPeg");
|
|
|
|
|
2015-06-09 18:40:42 +02:00
|
|
|
module.exports = React.createClass({
|
2015-06-19 17:21:09 +02:00
|
|
|
displayName: 'RoomTile',
|
2015-06-19 13:53:48 +02:00
|
|
|
mixins: [RoomTileController],
|
2015-06-09 18:40:42 +02:00
|
|
|
render: function() {
|
2015-06-22 15:48:58 +02:00
|
|
|
var myUserId = MatrixClientPeg.get().credentials.userId;
|
2015-06-12 18:34:17 +02:00
|
|
|
var classes = classNames({
|
|
|
|
'mx_RoomTile': true,
|
2015-06-18 15:35:17 +02:00
|
|
|
'selected': this.props.selected,
|
2015-06-22 15:48:58 +02:00
|
|
|
'unread': this.props.unread,
|
|
|
|
'invited': this.props.room.currentState.members[myUserId].membership == 'invite'
|
2015-06-12 18:34:17 +02:00
|
|
|
});
|
2015-06-09 18:40:42 +02:00
|
|
|
return (
|
2015-06-12 18:34:17 +02:00
|
|
|
<div className={classes} onClick={this.onClick}>
|
2015-06-12 15:59:33 +02:00
|
|
|
<div className="mx_RoomTile_name">{this.props.room.name}</div>
|
2015-06-09 18:40:42 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|