From 378d975eaa53d6c153c44471f03f9b49660cf0b0 Mon Sep 17 00:00:00 2001
From: =Corey Hulen <corey@hulen.com>
Date: Tue, 6 Oct 2015 13:44:52 -0700
Subject: PLT-519 toggle team creation link based on config setting

---
 web/react/components/navbar_dropdown.jsx | 39 ++++++++++++++++++--------------
 1 file changed, 22 insertions(+), 17 deletions(-)

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

diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx
index 78057d10b..30c4e94ae 100644
--- a/web/react/components/navbar_dropdown.jsx
+++ b/web/react/components/navbar_dropdown.jsx
@@ -135,30 +135,35 @@ export default class NavbarDropdown extends React.Component {
 
         var teams = [];
 
-        teams.push(
-            <li
-                className='divider'
-                key='div'
-            >
-            </li>
-        );
-
         if (this.state.teams.length > 1) {
+            teams.push(
+                <li
+                    className='divider'
+                    key='div'
+                >
+                </li>
+            );
+
             this.state.teams.forEach((teamName) => {
                 if (teamName !== this.props.teamName) {
                     teams.push(<li key={teamName}><a href={Utils.getWindowLocationOrigin() + '/' + teamName}>{'Switch to ' + teamName}</a></li>);
                 }
             });
         }
-        teams.push(<li key='newTeam_li'>
-                        <a
-                            key='newTeam_a'
-                            target='_blank'
-                            href={Utils.getWindowLocationOrigin() + '/signup_team'}
-                        >
-                            {'Create a New Team'}
-                        </a>
-                    </li>);
+
+        if (global.window.config.EnableTeamCreation === 'true') {
+            teams.push(
+                <li key='newTeam_li'>
+                    <a
+                        key='newTeam_a'
+                        target='_blank'
+                        href={Utils.getWindowLocationOrigin() + '/signup_team'}
+                    >
+                        {'Create a New Team'}
+                    </a>
+                </li>
+            );
+        }
 
         return (
             <ul className='nav navbar-nav navbar-right'>
-- 
cgit v1.2.3-1-g7c22

