import React from 'react'; import classNames from 'classnames'; import { Avatar, AvatarSize } from './Avatar'; import { Emojify } from './conversation/Emojify'; import { LocalizerType } from '../types/Util'; interface Props { phoneNumber: string; isMe?: boolean; name?: string; profileName?: string; avatarPath?: string; i18n: LocalizerType; onClick?: () => void; } export class ContactListItem extends React.Component { public renderAvatar() { const { avatarPath, name, phoneNumber, profileName } = this.props; const userName = name || profileName || phoneNumber; return ( ); } public render() { const { i18n, name, onClick, isMe, phoneNumber, profileName } = this.props; const title = name ? name : phoneNumber; const displayName = isMe ? i18n('me') : title; const profileElement = !isMe && profileName && !name ? ( ~ ) : null; const showNumber = isMe || name; return (
{this.renderAvatar()}
{profileElement}
); } }