summaryrefslogtreecommitdiffstats
path: root/web/react/pages
diff options
context:
space:
mode:
authorElias Nahum <nahumhbl@gmail.com>2016-01-28 16:16:39 -0300
committerElias Nahum <nahumhbl@gmail.com>2016-01-28 16:16:39 -0300
commit53e495cf335d3c6b44361627288db252aae1f4ad (patch)
treed7fb30f15a5166d7ab47fe882478a086837d940f /web/react/pages
parentdb37897538f134b29784453797510c20e1e9303c (diff)
downloadchat-53e495cf335d3c6b44361627288db252aae1f4ad.tar.gz
chat-53e495cf335d3c6b44361627288db252aae1f4ad.tar.bz2
chat-53e495cf335d3c6b44361627288db252aae1f4ad.zip
PLT-7: Refactoring frontend (chunk 4)
Diffstat (limited to 'web/react/pages')
-rw-r--r--web/react/pages/find_team.jsx59
-rw-r--r--web/react/pages/signup_team.jsx2
2 files changed, 55 insertions, 6 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
diff --git a/web/react/pages/signup_team.jsx b/web/react/pages/signup_team.jsx
index 8f4f86a7c..c80b65580 100644
--- a/web/react/pages/signup_team.jsx
+++ b/web/react/pages/signup_team.jsx
@@ -60,7 +60,7 @@ global.window.setup_signup_team_page = function setup(props) {
for (var prop in props) {
if (props.hasOwnProperty(prop)) {
- if (prop !== 'Title') {
+ if (prop !== 'Title' && prop !== 'Locale' && prop !== 'Info') {
teams.push({name: prop, display_name: props[prop]});
}
}