From 12896bd23eeba79884245c1c29fdc568cf21a7fa Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Mon, 14 Mar 2016 08:50:46 -0400
Subject: Converting to Webpack. Stage 1.

---
 webapp/components/member_list_team.jsx | 62 ++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 webapp/components/member_list_team.jsx

(limited to 'webapp/components/member_list_team.jsx')

diff --git a/webapp/components/member_list_team.jsx b/webapp/components/member_list_team.jsx
new file mode 100644
index 000000000..bb5eee496
--- /dev/null
+++ b/webapp/components/member_list_team.jsx
@@ -0,0 +1,62 @@
+// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import FilteredUserList from './filtered_user_list.jsx';
+import TeamMembersDropdown from './team_members_dropdown.jsx';
+import UserStore from 'stores/user_store.jsx';
+
+import React from 'react';
+
+export default class MemberListTeam extends React.Component {
+    constructor(props) {
+        super(props);
+
+        this.getUsers = this.getUsers.bind(this);
+        this.onChange = this.onChange.bind(this);
+
+        this.state = {
+            users: this.getUsers()
+        };
+    }
+
+    componentDidMount() {
+        UserStore.addChangeListener(this.onChange);
+    }
+
+    componentWillUnmount() {
+        UserStore.removeChangeListener(this.onChange);
+    }
+
+    getUsers() {
+        const profiles = UserStore.getProfiles();
+        const users = [];
+
+        for (const id of Object.keys(profiles)) {
+            users.push(profiles[id]);
+        }
+
+        users.sort((a, b) => a.username.localeCompare(b.username));
+
+        return users;
+    }
+
+    onChange() {
+        this.setState({
+            users: this.getUsers()
+        });
+    }
+
+    render() {
+        return (
+            <FilteredUserList
+                style={this.props.style}
+                users={this.state.users}
+                actions={[TeamMembersDropdown]}
+            />
+        );
+    }
+}
+
+MemberListTeam.propTypes = {
+    style: React.PropTypes.object
+};
-- 
cgit v1.2.3-1-g7c22

