nicolium: fix modal navigation, probably

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-03-21 17:51:19 +01:00
parent a08f7f382a
commit e11add5157
2 changed files with 10 additions and 9 deletions

View File

@ -117,19 +117,18 @@ const Item: React.FC<IItem> = ({
// FIXME: wtf?
const handleClick: React.MouseEventHandler = (e: any) => {
e.preventDefault();
e.stopPropagation();
if (isIOS() && !e.target.autoPlay) {
e.target.autoPlay = true;
e.preventDefault();
} else if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
if (hoverToPlay()) {
e.target.pause();
e.target.currentTime = 0;
}
e.preventDefault();
onClick(index);
}
e.stopPropagation();
};
const handleVideoHover: React.MouseEventHandler<HTMLVideoElement> = ({

View File

@ -49,7 +49,9 @@ interface MediaModalProps {
}
const MediaModal: React.FC<MediaModalProps & BaseModalProps> = (props) => {
const { statusId, onClose, time = 0 } = props;
const { statusId, time = 0 } = props;
const onClose = () => props.onClose('MEDIA');
const intl = useIntl();
@ -301,7 +303,9 @@ const MediaModal: React.FC<MediaModalProps & BaseModalProps> = (props) => {
style={wrapperStyles}
className='⁂-media-modal__closer'
role='presentation'
onClick={() => {
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
onClose();
}}
>
@ -318,9 +322,7 @@ const MediaModal: React.FC<MediaModalProps & BaseModalProps> = (props) => {
<IconButton
title={intl.formatMessage(messages.close)}
src={iconX}
onClick={() => {
onClose('MEDIA');
}}
onClick={onClose}
theme='dark'
className='!p-1.5 hover:scale-105 hover:bg-gray-900'
iconClassName='h-5 w-5'