diff --git a/src/app/features/room/MediaGallery.tsx b/src/app/features/room/MediaGallery.tsx index bae6c024f..cd8543f7f 100644 --- a/src/app/features/room/MediaGallery.tsx +++ b/src/app/features/room/MediaGallery.tsx @@ -6,6 +6,8 @@ import { Icon, IconButton, Icons, + Overlay, + OverlayBackdrop, Scroll, Spinner, Text, @@ -15,6 +17,7 @@ import { config, } from 'folds'; import { EventType, MatrixClient, MatrixEvent, MsgType, Room } from 'matrix-js-sdk'; +import FocusTrap from 'focus-trap-react'; import classNames from 'classnames'; import { useNearViewport } from '../../hooks/useNearViewport'; import { IEncryptedFile, IImageInfo, IThumbnailContent } from '../../../types/matrix/common'; @@ -250,102 +253,112 @@ function Lightbox({ }); return ( - // eslint-disable-next-line jsx-a11y/no-static-element-interactions -
- {/* Header bar */} - }> + - - - {item.body || (item.msgtype === MsgType.Video ? 'Video' : 'Image')} - - - {item.sender} · {dateStr} - - - - {index + 1} / {items.length} - - - Close - - } + {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */} +
- {(ref) => ( - - - - )} - - + {/* Header bar */} + + + + {item.body || (item.msgtype === MsgType.Video ? 'Video' : 'Image')} + + + {item.sender} · {dateStr} + + + + {index + 1} / {items.length} + + + Close + + } + > + {(ref) => ( + + + + )} + + - {/* Media area with nav arrows */} - - {index > 0 && ( - - - - )} - - - - {index < items.length - 1 && ( - - - - )} - -
+ {index > 0 && ( + + + + )} + + + + {index < items.length - 1 && ( + + + + )} +
+
+ + ); }