Multiple person typing indicators in groups

This commit is contained in:
ayumi-signal 2023-09-18 14:17:26 -07:00 committed by GitHub
parent 17ea2b58de
commit e4238de4db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 342 additions and 115 deletions

View file

@ -60,7 +60,7 @@ export type PropsData = Pick<
| 'shouldShowDraft'
| 'title'
| 'type'
| 'typingContactId'
| 'typingContactIds'
| 'unblurredAvatarPath'
| 'unreadCount'
| 'unreadMentionsCount'
@ -104,13 +104,14 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
theme,
title,
type,
typingContactId,
typingContactIds,
unblurredAvatarPath,
unreadCount,
unreadMentionsCount,
serviceId,
}) {
const isMuted = Boolean(muteExpiresAt && Date.now() < muteExpiresAt);
const isSomeoneTyping = (typingContactIds?.length ?? 0) > 0;
const headerName = (
<>
{isMe ? (
@ -139,7 +140,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
{i18n('icu:ConversationListItem--message-request')}
</span>
);
} else if (typingContactId) {
} else if (isSomeoneTyping) {
messageText = <TypingAnimation i18n={i18n} />;
} else if (shouldShowDraft && draftPreview) {
messageText = (