schildi-web/src/molecules/RoomTile.js

27 lines
678 B
JavaScript
Raw Normal View History

var React = require('react');
var classNames = require('classnames');
var dis = require("../dispatcher");
module.exports = React.createClass({
onClick: function() {
dis.dispatch({
action: 'view_room',
room_id: this.props.room.roomId
});
},
render: function() {
var classes = classNames({
'mx_RoomTile': true,
2015-06-18 09:35:17 -04:00
'selected': this.props.selected,
'unread': this.props.unread
});
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>
);
}
});