New contact popup when clicking on group member or avatar

This commit is contained in:
Chris Svenningsen 2020-11-11 09:36:05 -08:00 committed by GitHub
parent cd599f92c8
commit d593f74241
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 717 additions and 44 deletions

View file

@ -102,6 +102,7 @@ export type PropsData = {
timestamp: number;
status?: MessageStatusType;
contact?: ContactType;
authorId: string;
authorTitle: string;
authorName?: string;
authorProfileName?: string;
@ -170,6 +171,7 @@ export type PropsActions = {
contact: ContactType;
signalAccount?: string;
}) => void;
showContactModal: (contactId: string) => void;
showVisualAttachment: (options: {
attachment: AttachmentType;
@ -1055,6 +1057,7 @@ export class Message extends React.PureComponent<Props, State> {
public renderAvatar(): JSX.Element | undefined {
const {
authorAvatarPath,
authorId,
authorName,
authorPhoneNumber,
authorProfileName,
@ -1064,6 +1067,7 @@ export class Message extends React.PureComponent<Props, State> {
conversationType,
direction,
i18n,
showContactModal,
} = this.props;
if (
@ -1071,12 +1075,16 @@ export class Message extends React.PureComponent<Props, State> {
conversationType !== 'group' ||
direction === 'outgoing'
) {
return;
return undefined;
}
// eslint-disable-next-line consistent-return
return (
<div className="module-message__author-avatar">
<button
type="button"
className="module-message__author-avatar"
onClick={() => showContactModal(authorId)}
tabIndex={0}
>
<Avatar
avatarPath={authorAvatarPath}
color={authorColor}
@ -1088,7 +1096,7 @@ export class Message extends React.PureComponent<Props, State> {
title={authorTitle}
size={28}
/>
</div>
</button>
);
}