Merge pull request #225 from aviraldg/fix-1174

Bring up MemberInfo on avatar click in EventTile
This commit is contained in:
Matthew Hodgson 2016-03-17 11:48:32 +00:00
commit e03d8626be

View file

@ -27,6 +27,7 @@ var TextForEvent = require('../../../TextForEvent');
var ContextualMenu = require('../../../ContextualMenu'); var ContextualMenu = require('../../../ContextualMenu');
var Velociraptor = require('../../../Velociraptor'); var Velociraptor = require('../../../Velociraptor');
require('../../../VelocityBounce'); require('../../../VelocityBounce');
var dispatcher = require("../../../dispatcher");
var bounce = false; var bounce = false;
try { try {
@ -304,12 +305,23 @@ module.exports = React.createClass({
var readAvatars = this.getReadAvatars(); var readAvatars = this.getReadAvatars();
function onMemberAvatarClicked(sender) {
return () => {
//var member = new Matrix.RoomMember(null, userId);
//if (!member) { return; }
dispatcher.dispatch({
action: 'view_user',
member: sender
});
};
}
var avatar, sender; var avatar, sender;
if (!this.props.continuation) { if (!this.props.continuation) {
if (this.props.mxEvent.sender) { if (this.props.mxEvent.sender) {
avatar = ( avatar = (
<div className="mx_EventTile_avatar"> <div className="mx_EventTile_avatar" style={{cursor: "pointer"}}>
<MemberAvatar member={this.props.mxEvent.sender} width={24} height={24} /> <MemberAvatar member={this.props.mxEvent.sender} width={24} height={24} onClick={onMemberAvatarClicked(this.props.mxEvent.sender)} />
</div> </div>
); );
} }