Skip to content

Commit

Permalink
Message: click on avatar show userDetailModal
Browse files Browse the repository at this point in the history
Disable the click on avatar because before it selected the message.
OnClick on avatar -> trigger event to show the UserDetails modal with this pubkey.
  • Loading branch information
Audric Ackermann committed Nov 27, 2019
1 parent e2e26dd commit 77fcd7c
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions ts/components/conversation/Message.tsx
Expand Up @@ -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}
Expand Down Expand Up @@ -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()}
Expand All @@ -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)}
Expand Down

0 comments on commit 77fcd7c

Please sign in to comment.