Add badges to avatars in group dialogs
This commit is contained in:
parent
7bb37dc63b
commit
e490d91cc4
11 changed files with 121 additions and 39 deletions
|
@ -4,8 +4,9 @@
|
|||
import type { ReactChild, ReactNode } from 'react';
|
||||
import React from 'react';
|
||||
|
||||
import type { LocalizerType } from '../types/Util';
|
||||
import type { LocalizerType, ThemeType } from '../types/Util';
|
||||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
import type { PreferredBadgeSelectorType } from '../state/selectors/badges';
|
||||
import { ModalHost } from './ModalHost';
|
||||
import { Button, ButtonVariant } from './Button';
|
||||
import { Avatar, AvatarSize } from './Avatar';
|
||||
|
@ -92,20 +93,29 @@ GroupDialog.Paragraph = ({
|
|||
|
||||
type ContactsPropsType = {
|
||||
contacts: Array<ConversationType>;
|
||||
getPreferredBadge: PreferredBadgeSelectorType;
|
||||
i18n: LocalizerType;
|
||||
theme: ThemeType;
|
||||
};
|
||||
|
||||
GroupDialog.Contacts = ({ contacts, i18n }: Readonly<ContactsPropsType>) => (
|
||||
GroupDialog.Contacts = ({
|
||||
contacts,
|
||||
getPreferredBadge,
|
||||
i18n,
|
||||
theme,
|
||||
}: Readonly<ContactsPropsType>) => (
|
||||
<ul className="module-GroupDialog__contacts">
|
||||
{contacts.map(contact => (
|
||||
<li key={contact.id} className="module-GroupDialog__contacts__contact">
|
||||
<Avatar
|
||||
acceptedMessageRequest={contact.acceptedMessageRequest}
|
||||
avatarPath={contact.avatarPath}
|
||||
badge={getPreferredBadge(contact.badges)}
|
||||
color={contact.color}
|
||||
conversationType={contact.type}
|
||||
isMe={contact.isMe}
|
||||
noteToSelf={contact.isMe}
|
||||
theme={theme}
|
||||
title={contact.title}
|
||||
unblurredAvatarPath={contact.unblurredAvatarPath}
|
||||
sharedGroupNames={contact.sharedGroupNames}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue