|
|
@ -85,9 +85,7 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}, [index]);
|
|
|
|
}, [index]);
|
|
|
|
|
|
|
|
|
|
|
|
const getIndex = () => {
|
|
|
|
const getIndex = () => index !== null ? index : props.index;
|
|
|
|
return index !== null ? index : props.index;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const toggleNavigation = () => {
|
|
|
|
const toggleNavigation = () => {
|
|
|
|
setNavigationHidden(!navigationHidden);
|
|
|
|
setNavigationHidden(!navigationHidden);
|
|
|
@ -164,15 +162,9 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const isMultiMedia = media.map((image) => {
|
|
|
|
const isMultiMedia = media.map((image) => image.type !== 'image').toArray();
|
|
|
|
if (image.type !== 'image') {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}).toArray();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const content = media.map(attachment => {
|
|
|
|
const content = media.map((attachment, i) => {
|
|
|
|
const width = (attachment.meta.getIn(['original', 'width']) || undefined) as number | undefined;
|
|
|
|
const width = (attachment.meta.getIn(['original', 'width']) || undefined) as number | undefined;
|
|
|
|
const height = (attachment.meta.getIn(['original', 'height']) || undefined) as number | undefined;
|
|
|
|
const height = (attachment.meta.getIn(['original', 'height']) || undefined) as number | undefined;
|
|
|
|
|
|
|
|
|
|
|
@ -204,6 +196,7 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
|
|
|
height={height}
|
|
|
|
height={height}
|
|
|
|
startTime={time}
|
|
|
|
startTime={time}
|
|
|
|
detailed
|
|
|
|
detailed
|
|
|
|
|
|
|
|
autoFocus={i === getIndex()}
|
|
|
|
link={link}
|
|
|
|
link={link}
|
|
|
|
alt={attachment.description}
|
|
|
|
alt={attachment.description}
|
|
|
|
key={attachment.url}
|
|
|
|
key={attachment.url}
|
|
|
|