1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-28 16:48:04 +02:00
onion/js/components/ascribe_modal/modal_password_request_reset.js

35 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 PasswordResetRequestForm from '../ascribe_forms/form_password_reset_request';
import GlobalNotificationModel from '../../models/global_notification_model';
import GlobalNotificationActions from '../../actions/global_notification_actions';
import { getLangText } from '../../utils/lang_utils.js';
2015-06-15 15:28:53 +02:00
let PasswordResetRequestModal = React.createClass({
propTypes: {
button: React.PropTypes.element
},
2015-06-15 15:28:53 +02:00
handleResetSuccess(){
2015-07-03 19:08:56 +02:00
let notificationText = getLangText('Request successfully sent, check your email');
2015-06-15 15:28:53 +02:00
let notification = new GlobalNotificationModel(notificationText, 'success', 50000);
GlobalNotificationActions.appendGlobalNotification(notification);
},
render() {
return (
<ModalWrapper
trigger={this.props.button}
2015-07-03 19:08:56 +02:00
title={getLangText('Reset your password')}
handleSuccess={this.handleResetSuccess}>
2015-06-15 15:28:53 +02:00
<PasswordResetRequestForm />
</ModalWrapper>
);
}
});
export default PasswordResetRequestModal;