Fix registration modal close behavior

This commit is contained in:
Ray Schamp 2018-01-25 15:01:42 -05:00
parent 6036fa79bc
commit 2a64d61fed
2 changed files with 7 additions and 6 deletions
src/components
modal/base
registration

View file

@ -7,13 +7,14 @@ const ReactModal = require('react-modal');
require('./modal.scss');
ReactModal.setAppElement(document.getElementById('view'));
/**
* Container for pop up windows (See: registration window)
*/
class Modal extends React.Component {
constructor (props) {
super(props);
// ReactModal.setAppElement(document.getElementById('view'));
bindAll(this, [
'handleRequestClose'
]);

View file

@ -26,7 +26,7 @@ class Registration extends React.Component {
handleMessage (e) {
if (e.origin !== window.location.origin) return;
if (e.source !== this.registrationIframe.contentWindow) return;
if (e.data === 'registration-done') this.props.handleRegistrationDone();
if (e.data === 'registration-done') this.props.onRegistrationDone();
if (e.data === 'registration-relaunch') {
this.registrationIframe.contentWindow.location.reload();
}
@ -47,16 +47,16 @@ class Registration extends React.Component {
}}
isOpen={this.props.isOpen}
src="/accounts/standalone-registration/"
onRequestClose={this.props.handleRequestClose}
onRequestClose={this.props.onRequestClose}
/>
);
}
}
Registration.propTypes = {
handleRegistrationDone: PropTypes.func,
handleRequestClose: PropTypes.func,
isOpen: PropTypes.bool
isOpen: PropTypes.bool,
onRegistrationDone: PropTypes.func,
onRequestClose: PropTypes.func
};
module.exports = Registration;