Message: click on avatar show userDetailModal

Disable the click on avatar because before it selected the message.
OnClick on avatar -> trigger event to show the UserDetails modal with this pubkey.
pull/662/head
Audric Ackermann 5 years ago
parent 9992a3da1d
commit 2c914c554d

@ -673,7 +673,13 @@ export class Message extends React.PureComponent<Props, State> {
}
return (
<div className="module-message__author-avatar">
<div
className="module-message__author-avatar"
role="button"
onClick={() => {
onShowUserDetails(authorPhoneNumber);
}}
>
<Avatar
avatarPath={authorAvatarPath}
color={authorColor}
@ -1084,17 +1090,7 @@ export class Message extends React.PureComponent<Props, State> {
const enableContextMenu = !isRss && !multiSelectMode;
return (
<div
className={classNames(divClasses)}
role="button"
onClick={() => {
const selection = window.getSelection();
if (selection && selection.type === 'Range') {
return;
}
this.props.onSelectMessage();
}}
>
<div className={classNames(divClasses)}>
<ContextMenuTrigger id={rightClickTriggerId}>
{this.renderCheckBox()}
{this.renderAvatar()}
@ -1104,6 +1100,14 @@ export class Message extends React.PureComponent<Props, State> {
`module-message--${direction}`,
expiring ? 'module-message--expired' : null
)}
role="button"
onClick={() => {
const selection = window.getSelection();
if (selection && selection.type === 'Range') {
return;
}
this.props.onSelectMessage();
}}
>
{this.renderError(isIncoming)}
{isRss ? null : this.renderMenu(!isIncoming, triggerId)}

Loading…
Cancel
Save