1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 17:45:10 +01:00
onion/js/components/ascribe_modal/modal_signup.js

33 lines
1.1 KiB
JavaScript
Raw Normal View History

2015-06-15 15:28:53 +02:00
'use strict';
import React from 'react';
import ModalWrapper from './modal_wrapper';
import SignupForm from '../ascribe_forms/form_signup';
import GlobalNotificationModel from '../../models/global_notification_model';
import GlobalNotificationActions from '../../actions/global_notification_actions';
2015-07-03 19:08:56 +02:00
import { getLangText } from '../../utils/lang_utils.js'
2015-06-15 15:28:53 +02:00
let SignupModal = React.createClass({
handleSignupSuccess(response){
2015-07-03 19:08:56 +02:00
let notificationText = getLangText('We sent an email to your address') + ' ' + response.user.email + ', ' + getLangText('please confirm') + '.';
2015-06-15 15:28:53 +02:00
let notification = new GlobalNotificationModel(notificationText, 'success', 50000);
GlobalNotificationActions.appendGlobalNotification(notification);
},
render() {
return (
<ModalWrapper
button={this.props.button}
2015-07-03 19:08:56 +02:00
title={getLangText('Create an account')}
2015-06-15 15:28:53 +02:00
handleSuccess={this.handleSignupSuccess}
2015-07-03 19:08:56 +02:00
tooltip={getLangText('Sign up to ascribe')}>
2015-06-15 15:28:53 +02:00
<SignupForm />
</ModalWrapper>
);
}
});
export default SignupModal;