Only bold the profile name for messages

pull/388/head
Beaudan 6 years ago
parent 958766dc65
commit 3ea3a394e7

@ -10,20 +10,27 @@ interface Props {
profileName?: string;
i18n: LocalizerType;
module?: string;
boldProfileName?: Boolean;
}
export class ContactName extends React.Component<Props> {
public render() {
const { phoneNumber, name, profileName, i18n, module } = this.props;
const { phoneNumber, name, profileName, i18n, module, boldProfileName } = this.props;
const prefix = module ? module : 'module-contact-name';
const title = name ? name : phoneNumber;
const shouldShowProfile = Boolean(profileName && !name);
const profileElement = shouldShowProfile ? (
<span className={`${prefix}__profile-name`}>
<b><Emojify text={profileName || ''} i18n={i18n} /></b>
</span>
) : null;
const profileElement = shouldShowProfile ?
(boldProfileName ? (
<span className={`${prefix}__profile-name`}>
<b><Emojify text={profileName || ''} i18n={i18n} /></b>
</span>
) : (
<span className={`${prefix}__profile-name`}>
<Emojify text={profileName || ''} i18n={i18n} />
</span>
))
: null;
return (
<span className={prefix} dir="auto">

@ -312,6 +312,7 @@ export class Message extends React.PureComponent<Props, State> {
profileName={authorProfileName}
module="module-message__author"
i18n={i18n}
boldProfileName={true}
/>
</div>
);

Loading…
Cancel
Save