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'); ...@@ -7,13 +7,14 @@ const ReactModal = require('react-modal');
require('./modal.scss'); require('./modal.scss');
ReactModal.setAppElement(document.getElementById('view'));
/** /**
* Container for pop up windows (See: registration window) * Container for pop up windows (See: registration window)
*/ */
class Modal extends React.Component { class Modal extends React.Component {
constructor (props) { constructor (props) {
super(props); super(props);
// ReactModal.setAppElement(document.getElementById('view'));
bindAll(this, [ bindAll(this, [
'handleRequestClose' 'handleRequestClose'
]); ]);
......
...@@ -26,7 +26,7 @@ class Registration extends React.Component { ...@@ -26,7 +26,7 @@ class Registration extends React.Component {
handleMessage (e) { handleMessage (e) {
if (e.origin !== window.location.origin) return; if (e.origin !== window.location.origin) return;
if (e.source !== this.registrationIframe.contentWindow) 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') { if (e.data === 'registration-relaunch') {
this.registrationIframe.contentWindow.location.reload(); this.registrationIframe.contentWindow.location.reload();
} }
...@@ -47,16 +47,16 @@ class Registration extends React.Component { ...@@ -47,16 +47,16 @@ class Registration extends React.Component {
}} }}
isOpen={this.props.isOpen} isOpen={this.props.isOpen}
src="/accounts/standalone-registration/" src="/accounts/standalone-registration/"
onRequestClose={this.props.handleRequestClose} onRequestClose={this.props.onRequestClose}
/> />
); );
} }
} }
Registration.propTypes = { Registration.propTypes = {
handleRegistrationDone: PropTypes.func, isOpen: PropTypes.bool,
handleRequestClose: PropTypes.func, onRegistrationDone: PropTypes.func,
isOpen: PropTypes.bool onRequestClose: PropTypes.func
}; };
module.exports = Registration; 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