Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Bring up MemberInfo on avatar click in EventTile #225

Merged
merged 1 commit into from
Mar 17, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Bring up MemberInfo on avatar click in EventTile
  • Loading branch information
aviraldg committed Mar 16, 2016
commit bd7f56007ab2a1e2e0e3b21b92da3d934fea3ac2
16 changes: 14 additions & 2 deletions src/components/views/rooms/EventTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var TextForEvent = require('../../../TextForEvent');
var ContextualMenu = require('../../../ContextualMenu');
var Velociraptor = require('../../../Velociraptor');
require('../../../VelocityBounce');
var dispatcher = require("../../../dispatcher");

var bounce = false;
try {
Expand Down Expand Up @@ -304,12 +305,23 @@ module.exports = React.createClass({

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;
if (!this.props.continuation) {
if (this.props.mxEvent.sender) {
avatar = (
<div className="mx_EventTile_avatar">
<MemberAvatar member={this.props.mxEvent.sender} width={24} height={24} />
<div className="mx_EventTile_avatar" style={{cursor: "pointer"}}>
<MemberAvatar member={this.props.mxEvent.sender} width={24} height={24} onClick={onMemberAvatarClicked(this.props.mxEvent.sender)} />
</div>
);
}
Expand Down