|
|
@ -50,6 +50,7 @@ function getContactColor(contact: ContactType) {
|
|
|
|
|
|
|
|
|
|
|
|
const AddressBookItem = React.memo((_props: any) => {
|
|
|
|
const AddressBookItem = React.memo((_props: any) => {
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
|
|
|
|
style,
|
|
|
|
entry,
|
|
|
|
entry,
|
|
|
|
onClick,
|
|
|
|
onClick,
|
|
|
|
} = _props;
|
|
|
|
} = _props;
|
|
|
@ -57,6 +58,7 @@ const AddressBookItem = React.memo((_props: any) => {
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<ListItem
|
|
|
|
<ListItem
|
|
|
|
|
|
|
|
style={style}
|
|
|
|
leftIcon={
|
|
|
|
leftIcon={
|
|
|
|
<Avatar style={{ backgroundColor: getContactColor(entry) }}>
|
|
|
|
<Avatar style={{ backgroundColor: getContactColor(entry) }}>
|
|
|
|
{name && name[0] && name[0].toUpperCase()}
|
|
|
|
{name && name[0] && name[0].toUpperCase()}
|
|
|
@ -104,13 +106,12 @@ class AddressBook extends React.PureComponent<PropsType> {
|
|
|
|
rowHeight={56}
|
|
|
|
rowHeight={56}
|
|
|
|
rowRenderer={({ index, key, style }) => {
|
|
|
|
rowRenderer={({ index, key, style }) => {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div style={style}>
|
|
|
|
<AddressBookItem
|
|
|
|
<AddressBookItem
|
|
|
|
key={key}
|
|
|
|
key={key}
|
|
|
|
style={style}
|
|
|
|
entry={entries[index]}
|
|
|
|
entry={entries[index]}
|
|
|
|
onClick={this.props.onItemClick}
|
|
|
|
onClick={this.props.onItemClick}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|