trigger showUserDetails on message's avatar clicks
This commit is contained in:
parent
acea116d4f
commit
061556bb7d
|
@ -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);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue