summaryrefslogtreecommitdiffstats
path: root/web/react/components/user_list.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-03-03 15:15:56 -0500
committerChristopher Speller <crspeller@gmail.com>2016-03-03 15:15:56 -0500
commita413c8ffa684b72840f116380c04a61f1d9cf524 (patch)
tree287e855db2906058928f1916cbd3fa84857fdcc3 /web/react/components/user_list.jsx
parentbc2768fd254e82b6ca39a916436ab4747898578e (diff)
parent449f1000e999c409f754724cb998f0b9f90cdd59 (diff)
downloadchat-a413c8ffa684b72840f116380c04a61f1d9cf524.tar.gz
chat-a413c8ffa684b72840f116380c04a61f1d9cf524.tar.bz2
chat-a413c8ffa684b72840f116380c04a61f1d9cf524.zip
Merge pull request #2318 from hmhealey/plt1090
PLT-1090 Refactored modals that display users
Diffstat (limited to 'web/react/components/user_list.jsx')
-rw-r--r--web/react/components/user_list.jsx53
1 files changed, 53 insertions, 0 deletions
diff --git a/web/react/components/user_list.jsx b/web/react/components/user_list.jsx
new file mode 100644
index 000000000..39453a827
--- /dev/null
+++ b/web/react/components/user_list.jsx
@@ -0,0 +1,53 @@
+// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import {FormattedMessage} from 'mm-intl';
+import UserListRow from './user_list_row.jsx';
+
+export default class UserList extends React.Component {
+ render() {
+ const users = this.props.users;
+
+ let content;
+ if (users.length > 0) {
+ content = users.map((user) => {
+ return (
+ <UserListRow
+ key={user.id}
+ user={user}
+ actions={this.props.actions}
+ />
+ );
+ });
+ } else {
+ content = (
+ <tr key='no-users-found'>
+ <td>
+ <FormattedMessage
+ id='user_list.notFound'
+ defaultMessage='No users found :('
+ />
+ </td>
+ </tr>
+ );
+ }
+
+ return (
+ <table className='more-table table'>
+ <tbody>
+ {content}
+ </tbody>
+ </table>
+ );
+ }
+}
+
+UserList.defaultProps = {
+ users: [],
+ actions: []
+};
+
+UserList.propTypes = {
+ users: React.PropTypes.arrayOf(React.PropTypes.object),
+ actions: React.PropTypes.arrayOf(React.PropTypes.func)
+};