fix(contact-list): call getAvatarURL directly

Instead of going through the Avatar object, call the getAvatarURL
directly so that the code flows consistently use the participant
representation within redux.
This commit is contained in:
Leonard Kim 2017-09-08 13:52:07 -07:00 committed by yanas
parent 082fe711f2
commit 4b2795502c
1 changed files with 8 additions and 7 deletions

View File

@ -2,10 +2,8 @@ import Button from '@atlaskit/button';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Avatar from '../../../../modules/UI/avatar/Avatar';
import { translate } from '../../base/i18n'; import { translate } from '../../base/i18n';
import { getParticipants } from '../../base/participants'; import { getAvatarURL, getParticipants } from '../../base/participants';
import { openInviteDialog } from '../../invite'; import { openInviteDialog } from '../../invite';
import ContactListItem from './ContactListItem'; import ContactListItem from './ContactListItem';
@ -114,15 +112,18 @@ class ContactListPanel extends Component {
* @returns {ReactElement[]} * @returns {ReactElement[]}
*/ */
_renderContacts() { _renderContacts() {
return this.props._participants.map(({ avatarId, id, name }) => return this.props._participants.map(participant => {
( // eslint-disable-line no-extra-parens const { id, name } = participant;
return (
<ContactListItem <ContactListItem
avatarURI = { interfaceConfig.SHOW_CONTACTLIST_AVATARS avatarURI = { interfaceConfig.SHOW_CONTACTLIST_AVATARS
? Avatar.getAvatarUrl(avatarId) : null } ? getAvatarURL(participant) : null }
id = { id } id = { id }
key = { id } key = { id }
name = { name } /> name = { name } />
)); );
});
} }
/** /**