parent
fa86d1d5dd
commit
901861d5b8
|
@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Chats: don't display "copy" button for messages without text.
|
- Chats: don't display "copy" button for messages without text.
|
||||||
- Posts: don't have to click the play button twice for embedded videos.
|
- Posts: don't have to click the play button twice for embedded videos.
|
||||||
- index.html: remove `referrer` meta tag so it doesn't conflict with backend's `Referrer-Policy` header.
|
- index.html: remove `referrer` meta tag so it doesn't conflict with backend's `Referrer-Policy` header.
|
||||||
|
- Modals: fix media modal automatically switching to video.
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
- Admin: single user mode. Now the homepage can be redirected to any URL.
|
- Admin: single user mode. Now the homepage can be redirected to any URL.
|
||||||
|
|
|
@ -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;
|
const content = media.map((attachment, i) => {
|
||||||
}).toArray();
|
|
||||||
|
|
||||||
const content = media.map(attachment => {
|
|
||||||
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}
|
||||||
|
|
|
@ -39,6 +39,7 @@ const VideoModal: React.FC<IVideoModal> = ({ status, account, media, time, onClo
|
||||||
startTime={time}
|
startTime={time}
|
||||||
link={link}
|
link={link}
|
||||||
detailed
|
detailed
|
||||||
|
autoFocus
|
||||||
alt={media.description}
|
alt={media.description}
|
||||||
visible
|
visible
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -106,6 +106,7 @@ interface IVideo {
|
||||||
height?: number,
|
height?: number,
|
||||||
startTime?: number,
|
startTime?: number,
|
||||||
detailed?: boolean,
|
detailed?: boolean,
|
||||||
|
autoFocus?: boolean,
|
||||||
inline?: boolean,
|
inline?: boolean,
|
||||||
cacheWidth?: (width: number) => void,
|
cacheWidth?: (width: number) => void,
|
||||||
visible?: boolean,
|
visible?: boolean,
|
||||||
|
@ -119,6 +120,7 @@ const Video: React.FC<IVideo> = ({
|
||||||
width,
|
width,
|
||||||
visible = false,
|
visible = false,
|
||||||
detailed = false,
|
detailed = false,
|
||||||
|
autoFocus = false,
|
||||||
cacheWidth,
|
cacheWidth,
|
||||||
startTime,
|
startTime,
|
||||||
src,
|
src,
|
||||||
|
@ -518,7 +520,7 @@ const Video: React.FC<IVideo> = ({
|
||||||
aria-label={intl.formatMessage(paused ? messages.play : messages.pause)}
|
aria-label={intl.formatMessage(paused ? messages.play : messages.pause)}
|
||||||
className='player-button'
|
className='player-button'
|
||||||
onClick={togglePlay}
|
onClick={togglePlay}
|
||||||
autoFocus={detailed}
|
autoFocus={autoFocus}
|
||||||
>
|
>
|
||||||
<Icon src={paused ? require('@tabler/icons/player-play.svg') : require('@tabler/icons/player-pause.svg')} />
|
<Icon src={paused ? require('@tabler/icons/player-play.svg') : require('@tabler/icons/player-pause.svg')} />
|
||||||
</button>
|
</button>
|
||||||
|
|
Loading…
Reference in New Issue