Indicate when reaction is from the current user
This commit is contained in:
parent
c2d1979c1e
commit
7461250caf
6 changed files with 105 additions and 28 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue