summaryrefslogtreecommitdiffstats
path: root/web/react/pages/find_team.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/pages/find_team.jsx')
-rw-r--r--web/react/pages/find_team.jsx59
1 files changed, 54 insertions, 5 deletions
diff --git a/web/react/pages/find_team.jsx b/web/react/pages/find_team.jsx
index c4653fd77..ee2cf0de1 100644
--- a/web/react/pages/find_team.jsx
+++ b/web/react/pages/find_team.jsx
@@ -2,12 +2,61 @@
// See License.txt for license information.
import FindTeam from '../components/find_team.jsx';
+import * as Client from '../utils/client.jsx';
-function setupFindTeamPage() {
+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}
+ >
+ <FindTeam />
+ </IntlProvider>
+ );
+ }
+}
+
+global.window.setup_find_team_page = function setup(props) {
ReactDOM.render(
- <FindTeam />,
+ <Root map={props} />,
document.getElementById('find-team')
);
-}
-
-global.window.setup_find_team_page = setupFindTeamPage;
+}; \ No newline at end of file