element-web/themes/base/views/molecules/RoomTile.js

26 lines
869 B
JavaScript
Raw Normal View History

var React = require('react');
var classNames = require('classnames');
var RoomTileController = require("../../../../src/controllers/molecules/RoomTile");
var MatrixClientPeg = require("../../../../src/MatrixClientPeg");
2015-06-22 15:48:58 +02:00
module.exports = React.createClass({
displayName: 'RoomTile',
mixins: [RoomTileController],
render: function() {
2015-06-22 15:48:58 +02:00
var myUserId = MatrixClientPeg.get().credentials.userId;
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'
});
return (
<div className={classes} onClick={this.onClick}>
2015-06-12 15:59:33 +02:00
<div className="mx_RoomTile_name">{this.props.room.name}</div>
</div>
);
}
});