signal-desktop/ts/components/conversation/ConversationTitle.tsx
Scott Nonnenberg 548c8e69cf Emojification now all done with react via a few new components
Three locations were changed:
  1. a group update, which lists a set of contacts
  2. the contact name in the left pane
  3. the conversation title

Three new components were added to window.Signal.Components to support
these scenarios, respectively:
  1. Emojify
  2. ContactName
  3. ConversationTitle

Note that there are a number of other places in the app that should be
emojified, but never have been before. Essentially any place that a
contact name might be shown. A non-exhaustive list:
  - Show group members
  - Show safety number
  - Verified change notification
  - Disappearing timer change notification
  - Contact verification notification
  - Quote contact name
2018-05-23 16:26:47 -07:00

42 lines
1 KiB
TypeScript

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;
}
export class ConversationTitle extends React.Component<Props, {}> {
public render() {
const { name, phoneNumber, i18n, profileName, isVerified } = this.props;
return (
<span className="conversation-title">
{name ? (
<span className="conversation-name" dir="auto">
<Emojify text={name} />
</span>
) : null}
{phoneNumber ? (
<span className="conversation-number">{phoneNumber}</span>
) : null}{' '}
{profileName ? (
<span className="profileName">
<Emojify text={profileName} />
</span>
) : null}
{isVerified ? (
<span className="verified">
<span className="verified-icon" />
{i18n('verified')}
</span>
) : null}
</span>
);
}
}