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

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

Loading…
Cancel
Save