diff options
Diffstat (limited to 'webapp/components/user_list.jsx')
-rw-r--r-- | webapp/components/user_list.jsx | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/webapp/components/user_list.jsx b/webapp/components/user_list.jsx index 626cb3cf5..d34404c89 100644 --- a/webapp/components/user_list.jsx +++ b/webapp/components/user_list.jsx @@ -1,32 +1,29 @@ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import {FormattedMessage} from 'react-intl'; import UserListRow from './user_list_row.jsx'; +import LoadingScreen from 'components/loading_screen.jsx'; import React from 'react'; +import {FormattedMessage} from 'react-intl'; export default class UserList extends React.Component { render() { const users = this.props.users; let content; - if (users.length > 0) { + if (users == null) { + return <LoadingScreen/>; + } else if (users.length > 0) { content = users.map((user) => { - var teamMember; - for (var index in this.props.teamMembers) { - if (this.props.teamMembers[index].user_id === user.id) { - teamMember = this.props.teamMembers[index]; - } - } - return ( <UserListRow key={user.id} user={user} - teamMember={teamMember} + extraInfo={this.props.extraInfo[user.id]} actions={this.props.actions} actionProps={this.props.actionProps} + actionUserProps={this.props.actionUserProps[user.id]} /> ); }); @@ -56,14 +53,15 @@ export default class UserList extends React.Component { UserList.defaultProps = { users: [], - teamMembers: [], + extraInfo: {}, actions: [], actionProps: {} }; UserList.propTypes = { users: React.PropTypes.arrayOf(React.PropTypes.object), - teamMembers: React.PropTypes.arrayOf(React.PropTypes.object), + extraInfo: React.PropTypes.object, actions: React.PropTypes.arrayOf(React.PropTypes.func), - actionProps: React.PropTypes.object + actionProps: React.PropTypes.object, + actionUserProps: React.PropTypes.object }; |