schildi-web/src/views/molecules/RoomTile.js

26 lines
849 B
JavaScript
Raw Normal View History

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