2015-06-20 16:43:18 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
2015-07-13 16:57:25 +02:00
|
|
|
import SignupForm from './ascribe_forms/form_signup';
|
2015-07-13 20:47:43 +02:00
|
|
|
import Property from './ascribe_forms/property';
|
|
|
|
|
|
|
|
import { getLangText } from '../utils/lang_utils';
|
2015-06-20 16:43:18 +02:00
|
|
|
|
|
|
|
|
2015-06-22 10:50:22 +02:00
|
|
|
let SignupContainer = React.createClass({
|
2015-06-25 12:56:43 +02:00
|
|
|
getInitialState() {
|
2015-07-13 16:57:25 +02:00
|
|
|
return {
|
2015-06-22 10:50:22 +02:00
|
|
|
submitted: false,
|
|
|
|
message: null
|
2015-07-13 16:57:25 +02:00
|
|
|
};
|
2015-06-25 12:56:43 +02:00
|
|
|
},
|
|
|
|
|
2015-06-22 10:50:22 +02:00
|
|
|
handleSuccess(message){
|
|
|
|
this.setState({
|
|
|
|
submitted: true,
|
|
|
|
message: message
|
|
|
|
});
|
|
|
|
},
|
2015-06-25 12:56:43 +02:00
|
|
|
|
2015-06-20 16:43:18 +02:00
|
|
|
render() {
|
2015-06-22 10:50:22 +02:00
|
|
|
if (this.state.submitted){
|
|
|
|
return (
|
|
|
|
<div className="ascribe-login-wrapper">
|
|
|
|
<br/>
|
|
|
|
<div className="ascribe-login-text ascribe-login-header">
|
2015-07-13 21:09:39 +02:00
|
|
|
{this.state.message}
|
2015-06-22 10:50:22 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2015-06-20 16:43:18 +02:00
|
|
|
return (
|
|
|
|
<div className="ascribe-login-wrapper">
|
2015-07-13 21:09:39 +02:00
|
|
|
<SignupForm handleSuccess={this.handleSuccess}>
|
2015-07-13 20:47:43 +02:00
|
|
|
<Property
|
|
|
|
name='promo_code'
|
|
|
|
label={getLangText('Promocode')}>
|
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
placeholder={getLangText('Enter a promocode here (Optional)')}/>
|
|
|
|
</Property>
|
|
|
|
</SignupForm>
|
2015-06-20 16:43:18 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2015-07-13 16:57:25 +02:00
|
|
|
export default SignupContainer;
|