From bb25056d9afca501f147450466aaeecca9fef66f Mon Sep 17 00:00:00 2001 From: =Corey Hulen 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 ( +
+

{'Choose a Team'}

+
+ { + this.props.teams.map((team) => { + return ( +
+ +
+ {team.display_name} +
+
+
+ ); + }) + } +
+
+ ); + } + if (this.state.page === 'choose') { return (