diff --git a/ts/components/Avatar.tsx b/ts/components/Avatar.tsx
index 5bbc4dd61..b348fb33c 100644
--- a/ts/components/Avatar.tsx
+++ b/ts/components/Avatar.tsx
@@ -44,14 +44,22 @@ const NoImage = (props: {
name?: string;
pubkey?: string;
size: AvatarSize;
+ onAvatarClick?: () => void;
}) => {
- const { memberAvatars, size } = props;
+ const { name, memberAvatars, size, pubkey } = props;
// if no image but we have conversations set for the group, renders group members avatars
if (memberAvatars) {
- return ;
+ return (
+
+ );
}
- return ;
+ return ;
};
const AvatarImage = (props: {
@@ -87,11 +95,10 @@ export const Avatar = (props: Props) => {
setImageBroken(true);
};
- const isClosedGroupAvatar = memberAvatars && memberAvatars.length;
+ const isClosedGroupAvatar = Boolean(memberAvatars?.length);
const hasImage = (base64Data || urlToLoad) && !imageBroken && !isClosedGroupAvatar;
const isClickable = !!props.onAvatarClick;
-
return (
; // this is added by usingClosedConversationDetails
i18n: LocalizerType;
+ onAvatarClick?: () => void;
}
export class ClosedGroupAvatar extends React.PureComponent
{
@@ -29,7 +30,7 @@ export class ClosedGroupAvatar extends React.PureComponent {
}
public render() {
- const { memberAvatars, size } = this.props;
+ const { memberAvatars, size, onAvatarClick } = this.props;
const avatarsDiameter = this.getClosedGroupAvatarsSize(size);
const conv1 = memberAvatars.length > 0 ? memberAvatars[0] : undefined;
@@ -45,12 +46,14 @@ export class ClosedGroupAvatar extends React.PureComponent {
name={name1}
size={avatarsDiameter}
pubkey={conv1?.id}
+ onAvatarClick={onAvatarClick}
/>
);