trigger showUserDetails on message's avatar clicks

pull/662/head
Audric Ackermann 6 years ago
parent acea116d4f
commit 061556bb7d

@ -994,9 +994,8 @@
pubkey: userPubKey, pubkey: userPubKey,
avatarPath, avatarPath,
avatarColor: conversation.getColor(), avatarColor: conversation.getColor(),
onOk: async () => {}, onStartConversation: () => {
onStartConversation: async () => { Whisper.events.trigger('showConversation', userPubKey);
window.Whisper.events.trigger('showConversation', userPubKey);
}, },
}); });
} }

@ -26,7 +26,7 @@ interface State {
export class Avatar extends React.PureComponent<Props, State> { export class Avatar extends React.PureComponent<Props, State> {
public handleImageErrorBound: () => void; public handleImageErrorBound: () => void;
public onAvatarClickBound: () => void; public onAvatarClickBound: (e: any) => void;
public constructor(props: Props) { public constructor(props: Props) {
super(props); super(props);
@ -174,7 +174,9 @@ export class Avatar extends React.PureComponent<Props, State> {
hasImage ? 'module-avatar--with-image' : 'module-avatar--no-image', hasImage ? 'module-avatar--with-image' : 'module-avatar--no-image',
!hasImage ? `module-avatar--${color}` : null !hasImage ? `module-avatar--${color}` : null
)} )}
onClick={this.onAvatarClickBound} onClick={e => {
this.onAvatarClickBound(e);
}}
role="button" role="button"
> >
{hasImage ? this.renderAvatarOrIdenticon() : this.renderNoImage()} {hasImage ? this.renderAvatarOrIdenticon() : this.renderNoImage()}
@ -182,8 +184,9 @@ export class Avatar extends React.PureComponent<Props, State> {
); );
} }
private onAvatarClick() { private onAvatarClick(e: any) {
if (this.props.onAvatarClick) { if (this.props.onAvatarClick) {
e.stopPropagation();
this.props.onAvatarClick(); this.props.onAvatarClick();
} }
} }

Loading…
Cancel
Save