Improve display of unknown contacts in call links

This commit is contained in:
ayumi-signal 2024-06-10 14:12:45 -07:00 committed by GitHub
parent 7e31b37417
commit 33ec40d7b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 506 additions and 146 deletions

View file

@ -38,6 +38,7 @@ export enum AvatarSize {
TWENTY = 20,
TWENTY_FOUR = 24,
TWENTY_EIGHT = 28,
THIRTY = 30,
THIRTY_TWO = 32,
THIRTY_SIX = 36,
FORTY = 40,
@ -86,6 +87,7 @@ export type Props = {
const BADGE_PLACEMENT_BY_SIZE = new Map<number, BadgePlacementType>([
[28, { bottom: -4, right: -2 }],
[30, { bottom: -4, right: -2 }],
[32, { bottom: -4, right: -2 }],
[36, { bottom: -3, right: 0 }],
[40, { bottom: -6, right: -4 }],
@ -159,7 +161,10 @@ export function Avatar({
const initials = getInitials(title);
const hasImage = !noteToSelf && avatarPath && !imageBroken;
const shouldUseInitials =
!hasImage && conversationType === 'direct' && Boolean(initials);
!hasImage &&
conversationType === 'direct' &&
Boolean(initials) &&
title !== i18n('icu:unknownContact');
let contentsChildren: ReactNode;
if (loading) {