trigger showUserDetails on message's avatar clicks

This commit is contained in:
Audric Ackermann 2019-11-28 15:12:40 +11:00
parent acea116d4f
commit 061556bb7d
2 changed files with 8 additions and 6 deletions

View File

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

View File

@ -26,7 +26,7 @@ interface State {
export class Avatar extends React.PureComponent<Props, State> {
public handleImageErrorBound: () => void;
public onAvatarClickBound: () => void;
public onAvatarClickBound: (e: any) => void;
public constructor(props: 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--${color}` : null
)}
onClick={this.onAvatarClickBound}
onClick={e => {
this.onAvatarClickBound(e);
}}
role="button"
>
{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) {
e.stopPropagation();
this.props.onAvatarClick();
}
}