about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features/ui
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-07 18:23:36 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-07 18:23:36 +0100
commitd0d799f911925fcbb4d68360546f0245b86334bb (patch)
tree48cdf3f87b53834730c83a99677f654743723a9f /app/assets/javascripts/components/features/ui
parentf5c6baf29dde4d89c1c4611ac11b1da939523f06 (diff)
Replace react-skylight with own solution that centers images better
Diffstat (limited to 'app/assets/javascripts/components/features/ui')
-rw-r--r--app/assets/javascripts/components/features/ui/containers/modal_container.jsx37
1 files changed, 9 insertions, 28 deletions
diff --git a/app/assets/javascripts/components/features/ui/containers/modal_container.jsx b/app/assets/javascripts/components/features/ui/containers/modal_container.jsx
index 323125e30..b6c022736 100644
--- a/app/assets/javascripts/components/features/ui/containers/modal_container.jsx
+++ b/app/assets/javascripts/components/features/ui/containers/modal_container.jsx
@@ -1,6 +1,6 @@
 import { connect }           from 'react-redux';
-import { SkyLightStateless } from 'react-skylight';
 import { closeModal }        from '../../../actions/modal';
+import Lightbox              from '../../../components/lightbox';
 
 const mapStateToProps = state => ({
   url: state.getIn(['modal', 'url']),
@@ -17,30 +17,11 @@ const mapDispatchToProps = dispatch => ({
   }
 });
 
-const styles = {
-  overlayStyles: {
-
-  },
-
-  dialogStyles: {
-    width: '600px',
-    color: '#282c37',
-    fontSize: '16px',
-    lineHeight: '37px',
-    marginTop: '-300px',
-    left: '0',
-    right: '0',
-    marginLeft: 'auto',
-    marginRight: 'auto',
-    height: 'auto'
-  },
-
-  imageStyle: {
-    display: 'block',
-    maxWidth: '100%',
-    height: 'auto',
-    margin: '0 auto'
-  }
+const imageStyle = {
+  display: 'block',
+  maxWidth: '100%',
+  height: 'auto',
+  margin: '0 auto'
 };
 
 const Modal = React.createClass({
@@ -56,9 +37,9 @@ const Modal = React.createClass({
     const { url, ...other } = this.props;
 
     return (
-      <SkyLightStateless {...other} dialogStyles={styles.dialogStyles} overlayStyles={styles.overlayStyles}>
-        <img src={url} style={styles.imageStyle} />
-      </SkyLightStateless>
+      <Lightbox {...other}>
+        <img src={url} style={imageStyle} />
+      </Lightbox>
     );
   }