From bb25056d9afca501f147450466aaeecca9fef66f Mon Sep 17 00:00:00 2001
From: =Corey Hulen <corey@hulen.com>
Date: Tue, 27 Oct 2015 22:18:52 -0700
Subject: PLT-340

---
 web/react/components/signup_team.jsx | 48 ++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

(limited to 'web/react/components/signup_team.jsx')

diff --git a/web/react/components/signup_team.jsx b/web/react/components/signup_team.jsx
index 1858703ef..814ec2fc1 100644
--- a/web/react/components/signup_team.jsx
+++ b/web/react/components/signup_team.jsx
@@ -12,6 +12,11 @@ export default class TeamSignUp extends React.Component {
 
         this.updatePage = this.updatePage.bind(this);
 
+        if (global.window.mm_config.EnableTeamListing === 'true') {
+            this.state = {page: 'team_listing'};
+            return;
+        }
+
         var count = 0;
 
         if (global.window.mm_config.EnableSignUpWithEmail === 'true') {
@@ -31,11 +36,49 @@ export default class TeamSignUp extends React.Component {
         }
     }
 
+    componentDidMount() {
+        if (global.window.mm_config.EnableTeamListing === 'true' && this.props.teams.length === 1) {
+            window.location.href = '/' + this.props.teams[0].name;
+        }
+    }
+
     updatePage(page) {
         this.setState({page});
     }
 
     render() {
+        if (this.state.page === 'team_listing') {
+            return (
+                <div>
+                    <h3>{'Choose a Team'}</h3>
+                    <div className='signup-team-all'>
+                        {
+                            this.props.teams.map((team) => {
+                                return (
+                                    <div
+                                        key={'team_' + team.name}
+                                        className='signup-team-dir'
+                                    >
+                                        <a
+                                            href={'/' + team.name}
+                                        >
+                                            <div className='signup-team-dir__group'>
+                                                <span className='signup-team-dir__name'>{team.display_name}</span>
+                                                <span
+                                                    className='glyphicon glyphicon-menu-right right signup-team-dir__arrow'
+                                                    aria-hidden='true'
+                                                />
+                                            </div>
+                                        </a>
+                                    </div>
+                                );
+                            })
+                        }
+                    </div>
+                </div>
+            );
+        }
+
         if (this.state.page === 'choose') {
             return (
                 <ChoosePage
@@ -51,3 +94,8 @@ export default class TeamSignUp extends React.Component {
         }
     }
 }
+
+TeamSignUp.propTypes = {
+    teams: React.PropTypes.array
+};
+
-- 
cgit v1.2.3-1-g7c22


From 0b967b2acb5d5dc2da4f18c20a1cc4f8d1c8d8b1 Mon Sep 17 00:00:00 2001
From: =Corey Hulen <corey@hulen.com>
Date: Wed, 28 Oct 2015 08:58:27 -0700
Subject: Moving single team redirect to backend

---
 web/react/components/signup_team.jsx | 6 ------
 1 file changed, 6 deletions(-)

(limited to 'web/react/components/signup_team.jsx')

diff --git a/web/react/components/signup_team.jsx b/web/react/components/signup_team.jsx
index 814ec2fc1..f926f5cbb 100644
--- a/web/react/components/signup_team.jsx
+++ b/web/react/components/signup_team.jsx
@@ -36,12 +36,6 @@ export default class TeamSignUp extends React.Component {
         }
     }
 
-    componentDidMount() {
-        if (global.window.mm_config.EnableTeamListing === 'true' && this.props.teams.length === 1) {
-            window.location.href = '/' + this.props.teams[0].name;
-        }
-    }
-
     updatePage(page) {
         this.setState({page});
     }
-- 
cgit v1.2.3-1-g7c22

