diff options
Diffstat (limited to 'web/react/pages/signup_team_complete.jsx')
-rw-r--r-- | web/react/pages/signup_team_complete.jsx | 67 |
1 files changed, 58 insertions, 9 deletions
diff --git a/web/react/pages/signup_team_complete.jsx b/web/react/pages/signup_team_complete.jsx index d5ed144a1..1bee4e598 100644 --- a/web/react/pages/signup_team_complete.jsx +++ b/web/react/pages/signup_team_complete.jsx @@ -2,16 +2,65 @@ // See License.txt for license information. import SignupTeamComplete from '../components/signup_team_complete.jsx'; +import * as Client from '../utils/client.jsx'; -function setupSignupTeamCompletePage(props) { +var IntlProvider = ReactIntl.IntlProvider; + +class Root extends React.Component { + constructor() { + super(); + this.state = { + translations: null, + loaded: false + }; + } + + static propTypes() { + return { + map: React.PropTypes.object.isRequired + }; + } + + componentWillMount() { + Client.getTranslations( + this.props.map.Locale, + (data) => { + this.setState({ + translations: data, + loaded: true + }); + }, + () => { + this.setState({ + loaded: true + }); + } + ); + } + + render() { + if (!this.state.loaded) { + return <div></div>; + } + + return ( + <IntlProvider + locale={this.props.map.Locale} + messages={this.state.translations} + > + <SignupTeamComplete + email={this.props.map.Email} + hash={this.props.map.Hash} + data={this.props.map.Data} + /> + </IntlProvider> + ); + } +} + +global.window.setup_signup_team_complete_page = function setup(props) { ReactDOM.render( - <SignupTeamComplete - email={props.Email} - hash={props.Hash} - data={props.Data} - />, + <Root map={props} />, document.getElementById('signup-team-complete') ); -} - -global.window.setup_signup_team_complete_page = setupSignupTeamCompletePage; +};
\ No newline at end of file |