|
|
|
@ -10,6 +10,8 @@ import ImageLoader from './image_loader';
|
|
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
|
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
|
|
|
|
previous: { id: 'lightbox.previous', defaultMessage: 'Previous' },
|
|
|
|
|
next: { id: 'lightbox.next', defaultMessage: 'Next' },
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@injectIntl
|
|
|
|
@ -66,16 +68,10 @@ export default class MediaModal extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
|
|
const index = this.getIndex();
|
|
|
|
|
|
|
|
|
|
let leftNav, rightNav, content;
|
|
|
|
|
const leftNav = media.size > 1 && <button tabIndex='0' className='modal-container__nav modal-container__nav--left' onClick={this.handlePrevClick} aria-label={intl.formatMessage(messages.previous)}><i className='fa fa-fw fa-chevron-left' /></button>;
|
|
|
|
|
const rightNav = media.size > 1 && <button tabIndex='0' className='modal-container__nav modal-container__nav--right' onClick={this.handleNextClick} aria-label={intl.formatMessage(messages.next)}><i className='fa fa-fw fa-chevron-right' /></button>;
|
|
|
|
|
|
|
|
|
|
leftNav = rightNav = content = '';
|
|
|
|
|
|
|
|
|
|
if (media.size > 1) {
|
|
|
|
|
leftNav = <div role='button' tabIndex='0' className='modal-container__nav modal-container__nav--left' onClick={this.handlePrevClick}><i className='fa fa-fw fa-chevron-left' /></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>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
content = media.map((image) => {
|
|
|
|
|
const content = media.map((image) => {
|
|
|
|
|
const width = image.getIn(['meta', 'original', 'width']) || null;
|
|
|
|
|
const height = image.getIn(['meta', 'original', 'height']) || null;
|
|
|
|
|
|
|
|
|
|