First-class profile name rendering

This commit is contained in:
Scott Nonnenberg 2020-07-23 18:35:32 -07:00
parent 632cd0e87e
commit d07b8e82b2
63 changed files with 1044 additions and 454 deletions

View file

@ -10,6 +10,7 @@ export type Props = {
conversationType: 'group' | 'direct';
noteToSelf?: boolean;
title: string;
name?: string;
phoneNumber?: string;
profileName?: string;
@ -63,17 +64,13 @@ export class Avatar extends React.Component<Props, State> {
}
public renderImage() {
const { avatarPath, i18n, name, phoneNumber, profileName } = this.props;
const { avatarPath, i18n, title } = this.props;
const { imageBroken } = this.state;
if (!avatarPath || imageBroken) {
return null;
}
const title = `${name || phoneNumber}${
!name && profileName ? ` ~${profileName}` : ''
}`;
return (
<img
onError={this.handleImageErrorBound}