Commit 2a64d61f authored by Ray Schamp's avatar Ray Schamp

Fix registration modal close behavior

parent 6036fa79
......@@ -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'
]);
......
......@@ -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;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment