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
42 changed files with 57 additions and 423 deletions
@@ -71,13 +71,7 @@ export const ContactCheckbox: FunctionComponent<PropsType> = React.memo(
const headerName = isMe ? (
i18n('noteToSelf')
) : (
<ContactName
phoneNumber={phoneNumber}
name={name}
profileName={profileName}
title={title}
i18n={i18n}
/>
<ContactName title={title} />
);
let messageText: ReactNode;
@@ -54,13 +54,7 @@ export const ContactListItem: FunctionComponent<PropsType> = React.memo(
const headerName = isMe ? (
i18n('noteToSelf')
) : (
<ContactName
phoneNumber={phoneNumber}
name={name}
profileName={profileName}
title={title}
i18n={i18n}
/>
<ContactName title={title} />
);
const messageText =
@@ -91,13 +91,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
const headerName = isMe ? (
i18n('noteToSelf')
) : (
<ContactName
phoneNumber={phoneNumber}
name={name}
profileName={profileName}
title={title}
i18n={i18n}
/>
<ContactName title={title} />
);
let messageText: ReactNode = null;
@@ -62,23 +62,10 @@ const renderPerson = (
i18n: LocalizerType,
person: Readonly<{
isMe?: boolean;
name?: string;
phoneNumber?: string;
profileName?: string;
title: string;
}>
): ReactNode =>
person.isMe ? (
i18n('you')
) : (
<ContactName
phoneNumber={person.phoneNumber}
name={person.name}
profileName={person.profileName}
title={person.title}
i18n={i18n}
/>
);
person.isMe ? i18n('you') : <ContactName title={person.title} />;
// This function exists because bodyRanges tells us the character position
// where the at-mention starts at according to the full body text. The snippet