-var Api = require('./api.js').Api;
-var App = require('./app.js');
-var classNames = require('classnames');
-
-module.exports.SignupForm = React.createClass({
- getInitialState: function() {
- return {'hideMsg': true, 'msg': '', 'msgOk': false, 'password': '', 'email': ''};
- },
- handleSubmit: function(e) {
- Api.Call('SIGNUP',
- {
- 'password': this.state.password,
- 'email': this.state.email
- },
- function(err, status, data) {
- if (err) {
- console.error(err, data);
- this.displayMessage(App.errorCodeToMessage(err.code), false);
- return;
- }
-
- this.displayMessage('Thank You. Your account is being confirmed. Check your mailbox soon', true);
- this.props.onSuccess(data.token);
-
- }.bind(this));
+import Api from './api.js';
+import App from './app.js';
+import classNames from 'classnames';
+import React from 'react';
+
+class SignupForm extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {'hideMsg': true, 'msg': '', 'msgOk': false, 'password': '', 'email': ''};
+ }
+
+ handleSubmit = (e) => {
+ Api.Call(
+ 'SIGNUP',
+ {
+ 'password': this.state.password,
+ 'email': this.state.email
+ },
+ function(err, status, data) {
+ if (err) {
+ console.error(err, data);
+ this.displayMessage(App.errorCodeToMessage(err.code), false);
+ return;
+ }
+
+ this.displayMessage('Thank You. Your account is being confirmed. Check your mailbox soon', true);
+ this.props.onSuccess(data.token);
+
+ }.bind(this)
+);