Remove unnecessary props from <ContactName>

This commit is contained in:
Evan Hahn 2021-09-16 11:15:43 -05:00 committed by GitHub
parent 43685d15c6
commit eed7aff925
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 57 additions and 423 deletions

View file

@ -13,8 +13,6 @@ import { missingCaseError } from '../../util/missingCaseError';
type Contact = {
phoneNumber?: string;
profileName?: string;
name?: string;
title: string;
isMe?: boolean;
};
@ -57,13 +55,7 @@ export class GroupNotification extends React.Component<Props> {
key={`external-${contact.phoneNumber}`}
className="module-group-notification__contact"
>
<ContactName
title={contact.title}
phoneNumber={contact.phoneNumber}
profileName={contact.profileName}
name={contact.name}
i18n={i18n}
/>
<ContactName title={contact.title} />
</span>
);
})
@ -144,20 +136,14 @@ export class GroupNotification extends React.Component<Props> {
const firstChange: undefined | Change = changes[0];
const isLeftOnly = changes.length === 1 && firstChange?.type === 'remove';
const fromContact = (
<ContactName
title={from.title}
phoneNumber={from.phoneNumber}
profileName={from.profileName}
name={from.name}
i18n={i18n}
/>
);
const fromLabel = from.isMe ? (
<Intl i18n={i18n} id="youUpdatedTheGroup" />
) : (
<Intl i18n={i18n} id="updatedTheGroup" components={[fromContact]} />
<Intl
i18n={i18n}
id="updatedTheGroup"
components={[<ContactName title={from.title} />]}
/>
);
let contents: ReactNode;