You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
614 B
TypeScript
30 lines
614 B
TypeScript
import React from 'react';
|
|
|
|
import { Emojify } from './Emojify';
|
|
|
|
interface Props {
|
|
phoneNumber: string;
|
|
name?: string;
|
|
profileName?: string;
|
|
}
|
|
|
|
export class ContactName extends React.Component<Props, {}> {
|
|
public render() {
|
|
const { phoneNumber, name, profileName } = this.props;
|
|
|
|
const title = name ? name : phoneNumber;
|
|
const profileElement =
|
|
profileName && !name ? (
|
|
<span className="profile-name">
|
|
~<Emojify text={profileName} />
|
|
</span>
|
|
) : null;
|
|
|
|
return (
|
|
<span>
|
|
<Emojify text={title} /> {profileElement}
|
|
</span>
|
|
);
|
|
}
|
|
}
|