diff options
Diffstat (limited to 'app/assets/javascripts/components/features')
-rw-r--r-- | app/assets/javascripts/components/features/ui/containers/modal_container.jsx | 16 |
1 files changed, 12 insertions, 4 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 cd7d63a4a..eeec55ff5 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,8 @@ -import { connect } from 'react-redux'; -import { closeModal } from '../../../actions/modal'; -import Lightbox from '../../../components/lightbox'; +import { connect } from 'react-redux'; +import { closeModal } from '../../../actions/modal'; +import Lightbox from '../../../components/lightbox'; +import ImageLoader from 'react-imageloader'; +import LoadingIndicator from '../../../components/loading_indicator'; const mapStateToProps = state => ({ url: state.getIn(['modal', 'url']), @@ -23,6 +25,8 @@ const imageStyle = { maxHeight: '80vh' }; +const preloader = () => <LoadingIndicator />; + const Modal = React.createClass({ propTypes: { @@ -37,7 +41,11 @@ const Modal = React.createClass({ return ( <Lightbox {...other}> - <img src={url} style={imageStyle} /> + <ImageLoader + src={url} + preloader={preloader} + imgProps={{ style: imageStyle }} + /> </Lightbox> ); } |