diff --git a/app/soapbox/features/ui/components/modals/media-modal.tsx b/app/soapbox/features/ui/components/modals/media-modal.tsx index 959c433fd..875506175 100644 --- a/app/soapbox/features/ui/components/modals/media-modal.tsx +++ b/app/soapbox/features/ui/components/modals/media-modal.tsx @@ -15,6 +15,7 @@ import PlaceholderStatus from 'soapbox/features/placeholder/components/placehold import Thread from 'soapbox/features/status/components/thread'; import Video from 'soapbox/features/video'; import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; +import { isUserTouching } from 'soapbox/is-mobile'; import { makeGetStatus } from 'soapbox/selectors'; import ImageLoader from '../image-loader'; @@ -78,6 +79,8 @@ const MediaModal: React.FC = (props) => { const handleNextClick = () => setIndex((getIndex() + 1) % media.size); const handlePrevClick = () => setIndex((media.size + getIndex() - 1) % media.size); + const navigationHiddenClassName = navigationHidden ? 'pointer-events-none opacity-0' : ''; + const handleKeyDown = (e: KeyboardEvent) => { switch (e.key) { case 'ArrowLeft': @@ -101,7 +104,7 @@ const MediaModal: React.FC = (props) => { const getIndex = () => index !== null ? index : props.index; const toggleNavigation = () => { - setNavigationHidden(!navigationHidden); + setNavigationHidden(value => !value && isUserTouching()); }; const handleStatusClick: React.MouseEventHandler = e => { @@ -251,7 +254,11 @@ const MediaModal: React.FC = (props) => { } justifyContent='between' > - + = (props) => { {/* Height based on height of top/bottom bars */} -
+
{hasMultipleImages && ( -
+
{actualStatus && ( - +