Indicate when reaction is from the current user

This commit is contained in:
Ken Powers 2020-01-29 13:58:50 -08:00 committed by GitHub
parent c2d1979c1e
commit 7461250caf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 105 additions and 28 deletions

View file

@ -1,17 +1,21 @@
import React from 'react';
import { Emojify } from './Emojify';
import { Intl } from '../Intl';
import { LocalizerType } from '../../types/util';
interface Props {
phoneNumber: string;
phoneNumber?: string;
name?: string;
profileName?: string;
module?: string;
isMe?: boolean;
i18n?: LocalizerType;
}
export class ContactName extends React.Component<Props> {
public render() {
const { phoneNumber, name, profileName, module } = this.props;
const { phoneNumber, name, profileName, module, isMe, i18n } = this.props;
const prefix = module ? module : 'module-contact-name';
const title = name ? name : phoneNumber;
@ -22,11 +26,21 @@ export class ContactName extends React.Component<Props> {
</span>
) : null;
return (
<span className={prefix} dir="auto">
const fragment = (
<>
<Emojify text={title} />
{shouldShowProfile ? ' ' : null}
{profileElement}
</>
);
return (
<span className={prefix} dir="auto">
{isMe ? (
<Intl i18n={i18n} id="ContactName--you" components={[fragment]} />
) : (
fragment
)}
</span>
);
}