diff --git a/package.json b/package.json
index 18d507095..e77cf7d64 100644
--- a/package.json
+++ b/package.json
@@ -72,7 +72,7 @@
"react": "15.1.0",
"react-dom": "15.0.1",
"react-intl": "2.1.2",
- "react-modal": "1.3.0",
+ "react-modal": "1.5.2",
"react-onclickoutside": "4.1.1",
"react-redux": "4.4.5",
"react-responsive": "1.1.4",
diff --git a/src/components/intro/intro.jsx b/src/components/intro/intro.jsx
index acc1de4a7..b9372adbf 100644
--- a/src/components/intro/intro.jsx
+++ b/src/components/intro/intro.jsx
@@ -1,16 +1,13 @@
var connect = require('react-redux').connect;
-var omit = require('lodash.omit');
var React = require('react');
var sessionActions = require('../../redux/session.js');
-var Modal = require('../modal/modal.jsx');
+var IframeModal = require('../modal/iframe/modal.jsx');
var Registration = require('../registration/registration.jsx');
require('./intro.scss');
-Modal.setAppElement(document.getElementById('view'));
-
var Intro = React.createClass({
type: 'Intro',
getDefaultProps: function () {
@@ -52,11 +49,6 @@ var Intro = React.createClass({
this.closeRegistration();
},
render: function () {
- var frameProps = {
- width: 570,
- height: 357,
- padding: 15
- };
return (
@@ -130,15 +122,12 @@ var Intro = React.createClass({
-
-
-
+
);
}
diff --git a/src/components/intro/intro.scss b/src/components/intro/intro.scss
index 7d4be04ac..f827c9431 100644
--- a/src/components/intro/intro.scss
+++ b/src/components/intro/intro.scss
@@ -241,3 +241,13 @@
}
}
}
+
+.modal-content.mod-intro-video {
+ padding: 15px;
+ width: 35.625rem;
+}
+
+.modal-content-iframe.mod-intro-video {
+ width: 35.625rem;
+ min-height: 22.3125rem;
+}
diff --git a/src/components/modal/base/modal.jsx b/src/components/modal/base/modal.jsx
new file mode 100644
index 000000000..8492f83f5
--- /dev/null
+++ b/src/components/modal/base/modal.jsx
@@ -0,0 +1,58 @@
+var classNames = require('classnames');
+var omit = require('lodash.omit');
+var React = require('react');
+var ReactModal = require('react-modal');
+
+require('./modal.scss');
+
+/**
+ * Container for pop up windows (See: registration window)
+ */
+var Modal = React.createClass({
+ type: 'Modal',
+ statics: {
+ setAppElement: ReactModal.setAppElement
+ },
+ propTypes: {
+ className: React.PropTypes.string,
+ overlayClassName: React.PropTypes.string
+ },
+ getDefaultProps: function () {
+ return {
+ className: '',
+ overlayClassName: ''
+ };
+ },
+ requestClose: function () {
+ return this.refs.modal.portal.requestClose();
+ },
+ render: function () {
+ var modalClasses = classNames(
+ 'modal-content',
+ this.props.className
+ );
+ var overlayClasses = classNames(
+ 'modal-overlay',
+ this.props.overlayClassName
+ );
+ return (
+
+
+
![close-icon](/svgs/modal/close-x.svg)
+
+ {this.props.children}
+
+ );
+ }
+});
+
+module.exports = Modal;
diff --git a/src/components/modal/base/modal.scss b/src/components/modal/base/modal.scss
new file mode 100644
index 000000000..3d01d683f
--- /dev/null
+++ b/src/components/modal/base/modal.scss
@@ -0,0 +1,61 @@
+@import "../../../colors";
+@import "../../../frameless";
+
+.modal-content {
+ position: relative;
+ margin: 3.75rem auto;
+ border-radius: 1rem;
+ box-shadow: 0 0 0 1px $active-gray;
+ background-color: $ui-white;
+ padding: 0;
+ width: 48.75rem;
+}
+
+.modal-overlay {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 100;
+ background-color: transparentize($ui-blue, .3);
+}
+
+.ReactModal__Content:focus {
+ outline: none;
+}
+
+$modal-close-size: 1rem;
+.modal-content-close {
+ position: absolute;
+ top: $modal-close-size / 2;
+ right: $modal-close-size / 2;
+ border-radius: $modal-close-size;
+ background-color: $active-dark-gray;
+ cursor: pointer;
+ width: $modal-close-size * 2;
+ height: $modal-close-size * 2;
+ text-align: center;
+ line-height: $modal-close-size * 2;
+}
+
+.modal-content-close-img {
+ padding-top: $modal-close-size / 2;
+}
+
+@media only screen and (max-width: $desktop - 1) {
+ .modal-content {
+ top: 0;
+ left: 0;
+ margin-top: 0;
+ border-radius: 0;
+ box-shadow: none;
+ width: 100%;
+ height: 100%;
+ overflow: scroll;
+ }
+
+ .modal-content-close {
+ position: fixed;
+ }
+}
diff --git a/src/components/modal/iframe/modal.jsx b/src/components/modal/iframe/modal.jsx
new file mode 100644
index 000000000..5d69ea2eb
--- /dev/null
+++ b/src/components/modal/iframe/modal.jsx
@@ -0,0 +1,47 @@
+var classNames = require('classnames');
+var React = require('react');
+
+var Modal = require('../base/modal.jsx');
+
+require('./modal.scss');
+
+Modal.setAppElement(document.getElementById('view'));
+
+var IframeModal = React.createClass({
+ propTypes: {
+ componentKey: React.PropTypes.string,
+ isOpen: React.PropTypes.bool,
+ onRequestClose: React.PropTypes.func,
+ className: React.PropTypes.string,
+ componentRef: React.PropTypes.string,
+ src: React.PropTypes.string
+ },
+ getDefaultProps: function () {
+ return {
+ className: '',
+ iframeClassName: ''
+ };
+ },
+ render: function () {
+ var iframeClasses = classNames(
+ 'modal-content-iframe',
+ this.props.className
+ );
+ return (
+
+
+
+ );
+ }
+});
+
+module.exports = IframeModal;
diff --git a/src/components/modal/iframe/modal.scss b/src/components/modal/iframe/modal.scss
new file mode 100644
index 000000000..8c2a43a03
--- /dev/null
+++ b/src/components/modal/iframe/modal.scss
@@ -0,0 +1,5 @@
+@import "../../../frameless";
+
+.modal-content-iframe {
+ border: 0;
+}
diff --git a/src/components/modal/modal.jsx b/src/components/modal/modal.jsx
deleted file mode 100644
index 0e1d68c6e..000000000
--- a/src/components/modal/modal.jsx
+++ /dev/null
@@ -1,64 +0,0 @@
-var clone = require('lodash.clone');
-var defaultsDeep = require('lodash.defaultsdeep');
-var React = require('react');
-var ReactModal = require('react-modal');
-
-require('./modal.scss');
-
-var defaultStyle = {
- overlay: {
- zIndex: 100,
- backgroundColor: 'rgba(0, 0, 0, .75)'
- },
- content: {
- position: 'absolute',
- overflow: 'visible',
- borderRadius: '6px',
- width: 500,
- height: 250,
- padding: 0,
- top: '50%',
- right: 'auto',
- bottom: 'auto',
- left: '50%',
- marginTop: -125,
- marginLeft: -250
- }
-};
-
-/**
- * Container for pop up windows (See: registration window)
- */
-var Modal = React.createClass({
- type: 'Modal',
- statics: {
- setAppElement: ReactModal.setAppElement
- },
- getDefaultProps: function () {
- return {
- style: defaultStyle
- };
- },
- calculateStyle: function () {
- var style = clone(this.props.style, true);
- defaultsDeep(style, defaultStyle);
- style.content.marginTop = (style.content.height + style.content.padding*2) / -2;
- style.content.marginLeft = (style.content.width + style.content.padding*2) / -2;
- return style;
- },
- requestClose: function () {
- return this.refs.modal.portal.requestClose();
- },
- render: function () {
- return (
-
-
- {this.props.children}
-
- );
- }
-});
-
-module.exports = Modal;
diff --git a/src/components/modal/modal.scss b/src/components/modal/modal.scss
deleted file mode 100644
index bafe217d6..000000000
--- a/src/components/modal/modal.scss
+++ /dev/null
@@ -1,34 +0,0 @@
-@import "../../colors";
-
-.ReactModal__Content {
- &:focus {
- outline: none;
- }
-
- iframe {
- border: 0;
- }
-}
-
-.modal-close {
- $modal-close-size: 20px;
- position: absolute;
- top: 0;
- right: 0;
- margin-top: -$modal-close-size / 2;
- margin-right: -$modal-close-size / 2;
- border: 2px solid $ui-border;
- border-radius: $modal-close-size / 2;
- background-color: $active-dark-gray;
- cursor: pointer;
- width: $modal-close-size;
- height: $modal-close-size;
- text-align: center;
- line-height: $modal-close-size;
- color: $type-white;
- font-size: $modal-close-size;
-
- &:before {
- content: "x";
- }
-}
diff --git a/src/components/navigation/container/navigation.jsx b/src/components/navigation/base/navigation.jsx
similarity index 100%
rename from src/components/navigation/container/navigation.jsx
rename to src/components/navigation/base/navigation.jsx
diff --git a/src/components/navigation/container/navigation.scss b/src/components/navigation/base/navigation.scss
similarity index 100%
rename from src/components/navigation/container/navigation.scss
rename to src/components/navigation/base/navigation.scss
diff --git a/src/components/navigation/conference/navigation.jsx b/src/components/navigation/conference/navigation.jsx
index 72ab5ff8b..7e1192650 100644
--- a/src/components/navigation/conference/navigation.jsx
+++ b/src/components/navigation/conference/navigation.jsx
@@ -1,6 +1,6 @@
var React = require('react');
-var NavigationBox = require('../container/navigation.jsx');
+var NavigationBox = require('../base/navigation.jsx');
require('./navigation.scss');
diff --git a/src/components/navigation/www/navigation.jsx b/src/components/navigation/www/navigation.jsx
index d2ffc819b..8bd969917 100644
--- a/src/components/navigation/www/navigation.jsx
+++ b/src/components/navigation/www/navigation.jsx
@@ -15,8 +15,8 @@ var Form = require('../../forms/form.jsx');
var Input = require('../../forms/input.jsx');
var log = require('../../../lib/log.js');
var Login = require('../../login/login.jsx');
-var Modal = require('../../modal/modal.jsx');
-var NavigationBox = require('../container/navigation.jsx');
+var Modal = require('../../modal/base/modal.jsx');
+var NavigationBox = require('../base/navigation.jsx');
var Registration = require('../../registration/registration.jsx');
require('./navigation.scss');
diff --git a/src/components/registration/registration.jsx b/src/components/registration/registration.jsx
index 126e7a6bc..d234e7286 100644
--- a/src/components/registration/registration.jsx
+++ b/src/components/registration/registration.jsx
@@ -1,10 +1,8 @@
var React = require('react');
-var Modal = require('../modal/modal.jsx');
+var IframeModal = require('../modal/iframe/modal.jsx');
require('./registration.scss');
-Modal.setAppElement(document.getElementById('view'));
-
var Registration = React.createClass({
propTypes: {
isOpen: React.PropTypes.bool,
@@ -36,18 +34,14 @@ var Registration = React.createClass({
this.toggleMessageListener(false);
},
render: function () {
- var frameProps = {
- width: 610,
- height: 438
- };
return (
-
-
-
+
);
}
});
diff --git a/src/components/registration/registration.scss b/src/components/registration/registration.scss
index 7ed0be13d..b6ecb42ee 100644
--- a/src/components/registration/registration.scss
+++ b/src/components/registration/registration.scss
@@ -1,3 +1,22 @@
-.registration {
+@import "../../frameless";
+
+.modal-content.mod-registration {
+ width: 38.125rem;
overflow: hidden;
}
+
+.modal-content-iframe.mod-registration {
+ width: 38.125rem;
+ min-height: 27.375rem;
+}
+
+@media only screen and (max-width: $tablet - 1) {
+ .modal-content.mod-registration {
+ width: 100%;
+ overflow: scroll;
+ }
+
+ .modal-content-iframe.mod-registration {
+ height: 27.375rem;
+ }
+}
diff --git a/src/views/splash/splash.jsx b/src/views/splash/splash.jsx
index 4849312ab..b90a858bf 100644
--- a/src/views/splash/splash.jsx
+++ b/src/views/splash/splash.jsx
@@ -1,6 +1,5 @@
var connect = require('react-redux').connect;
var injectIntl = require('react-intl').injectIntl;
-var omit = require('lodash.omit');
var React = require('react');
var api = require('../../lib/api');
@@ -16,7 +15,7 @@ var Box = require('../../components/box/box.jsx');
var Button = require('../../components/forms/button.jsx');
var Carousel = require('../../components/carousel/carousel.jsx');
var Intro = require('../../components/intro/intro.jsx');
-var Modal = require('../../components/modal/modal.jsx');
+var IframeModal = require('../../components/modal/iframe/modal.jsx');
var News = require('../../components/news/news.jsx');
var Page = require('../../components/page/www/page.jsx');
var TeacherBanner = require('../../components/teacher-banner/teacher-banner.jsx');
@@ -308,7 +307,6 @@ var Splash = injectIntl(React.createClass({
},
render: function () {
var featured = this.renderHomepageRows();
- var emailConfirmationStyle = {width: 500, height: 330, padding: 1};
var homepageCacheState = this.getHomepageRefreshStatus();
var formatHTMLMessage = this.props.intl.formatHTMLMessage;
@@ -344,21 +342,23 @@ var Splash = injectIntl(React.createClass({
return (
{this.shouldShowEmailConfirmation() ? [
-
+
Confirm your email
{' '}to enable sharing.{' '}
Having trouble?
,
-
-
-
+
] : []}
{this.props.permissions.educator ? [
diff --git a/src/views/splash/splash.scss b/src/views/splash/splash.scss
index 841b2c73a..3cb87e3ba 100644
--- a/src/views/splash/splash.scss
+++ b/src/views/splash/splash.scss
@@ -42,6 +42,16 @@
}
}
+.modal-content.mod-confirmation {
+ width: 31.25rem;
+}
+
+.modal-content-iframe.mod-confirmation {
+ border-radius: 1rem;
+ width: 31.25rem;
+ min-height: 20.625rem;
+}
+
//4 columns
@media only screen and (max-width: $mobile - 1) {
.splash {
@@ -54,6 +64,15 @@
}
}
}
+
+ .modal-content.mod-confirmation {
+ width: 100%;
+ overflow: scroll;
+ }
+
+ .modal-content-iframe.mod-confirmation {
+ border-radius: 0;
+ }
}
//6 columns
@@ -68,6 +87,16 @@
}
}
}
+
+ .modal-content.mod-confirmation {
+ width: 100%;
+ overflow: scroll;
+ }
+
+ .modal-content-iframe.mod-confirmation {
+ border-radius: 0;
+ width: $tablet - 1;
+ }
}
//6 columns
diff --git a/static/svgs/modal/close-x.svg b/static/svgs/modal/close-x.svg
new file mode 100644
index 000000000..ae4c8027e
--- /dev/null
+++ b/static/svgs/modal/close-x.svg
@@ -0,0 +1,17 @@
+
+
+