mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-03-22 19:05:56 -04:00
Fix registration modal close behavior
This commit is contained in:
parent
6036fa79bc
commit
2a64d61fed
2 changed files with 7 additions and 6 deletions
src/components
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue