From 2a64d61fedaa42ecfb214c2c85165b723022dee2 Mon Sep 17 00:00:00 2001
From: Ray Schamp <ray@scratch.mit.edu>
Date: Thu, 25 Jan 2018 15:01:42 -0500
Subject: [PATCH] Fix registration modal close behavior

---
 src/components/modal/base/modal.jsx          |  3 ++-
 src/components/registration/registration.jsx | 10 +++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/components/modal/base/modal.jsx b/src/components/modal/base/modal.jsx
index 2d9fdc05e..613233a15 100644
--- a/src/components/modal/base/modal.jsx
+++ b/src/components/modal/base/modal.jsx
@@ -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'
         ]);
diff --git a/src/components/registration/registration.jsx b/src/components/registration/registration.jsx
index e0dd7d94e..fed69ed49 100644
--- a/src/components/registration/registration.jsx
+++ b/src/components/registration/registration.jsx
@@ -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;