2018-05-18 23:57:26 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { Emojify } from './Emojify';
|
|
|
|
import { Localizer } from '../../types/Util';
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
i18n: Localizer;
|
|
|
|
isVerified: boolean;
|
|
|
|
name?: string;
|
|
|
|
phoneNumber: string;
|
|
|
|
profileName?: string;
|
|
|
|
}
|
|
|
|
|
2018-05-22 19:31:43 +00:00
|
|
|
export class ConversationTitle extends React.Component<Props> {
|
2018-05-18 23:57:26 +00:00
|
|
|
public render() {
|
|
|
|
const { name, phoneNumber, i18n, profileName, isVerified } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<span className="conversation-title">
|
|
|
|
{name ? (
|
|
|
|
<span className="conversation-name" dir="auto">
|
2018-05-22 19:31:43 +00:00
|
|
|
<Emojify text={name} i18n={i18n} />
|
2018-05-18 23:57:26 +00:00
|
|
|
</span>
|
|
|
|
) : null}
|
|
|
|
{phoneNumber ? (
|
|
|
|
<span className="conversation-number">{phoneNumber}</span>
|
|
|
|
) : null}{' '}
|
2018-05-22 22:18:51 +00:00
|
|
|
{profileName && !name ? (
|
2018-05-18 23:57:26 +00:00
|
|
|
<span className="profileName">
|
2018-05-22 19:31:43 +00:00
|
|
|
<Emojify text={profileName} i18n={i18n} />
|
2018-05-18 23:57:26 +00:00
|
|
|
</span>
|
|
|
|
) : null}
|
|
|
|
{isVerified ? (
|
|
|
|
<span className="verified">
|
|
|
|
<span className="verified-icon" />
|
|
|
|
{i18n('verified')}
|
|
|
|
</span>
|
|
|
|
) : null}
|
|
|
|
</span>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|