|
|
@ -65,8 +65,6 @@ export default class MediaModal extends ImmutablePureComponent {
|
|
|
|
const { media, intl, onClose } = this.props;
|
|
|
|
const { media, intl, onClose } = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
const index = this.getIndex();
|
|
|
|
const index = this.getIndex();
|
|
|
|
const attachment = media.get(index);
|
|
|
|
|
|
|
|
const url = attachment.get('url');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let leftNav, rightNav, content;
|
|
|
|
let leftNav, rightNav, content;
|
|
|
|
|
|
|
|
|
|
|
@ -77,16 +75,18 @@ export default class MediaModal extends ImmutablePureComponent {
|
|
|
|
rightNav = <div role='button' tabIndex='0' className='modal-container__nav modal-container__nav--right' onClick={this.handleNextClick}><i className='fa fa-fw fa-chevron-right' /></div>;
|
|
|
|
rightNav = <div role='button' tabIndex='0' className='modal-container__nav modal-container__nav--right' onClick={this.handleNextClick}><i className='fa fa-fw fa-chevron-right' /></div>;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (attachment.get('type') === 'image') {
|
|
|
|
content = media.map((image) => {
|
|
|
|
content = media.map((image) => {
|
|
|
|
const width = image.getIn(['meta', 'original', 'width']) || null;
|
|
|
|
const width = image.getIn(['meta', 'original', 'width']) || null;
|
|
|
|
const height = image.getIn(['meta', 'original', 'height']) || null;
|
|
|
|
const height = image.getIn(['meta', 'original', 'height']) || null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (image.get('type') === 'image') {
|
|
|
|
return <ImageLoader previewSrc={image.get('preview_url')} src={image.get('url')} width={width} height={height} key={image.get('preview_url')} />;
|
|
|
|
return <ImageLoader previewSrc={image.get('preview_url')} src={image.get('url')} width={width} height={height} key={image.get('preview_url')} />;
|
|
|
|
}).toArray();
|
|
|
|
} else if (image.get('type') === 'gifv') {
|
|
|
|
} else if (attachment.get('type') === 'gifv') {
|
|
|
|
return <ExtendedVideoPlayer src={image.get('url')} muted controls={false} width={width} height={height} key={image.get('preview_url')} />;
|
|
|
|
content = <ExtendedVideoPlayer src={url} muted controls={false} />;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}).toArray();
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className='modal-root__modal media-modal'>
|
|
|
|
<div className='modal-root__modal media-modal'>
|
|
|
|