diff options
Diffstat (limited to 'src/view/com/lightbox')
5 files changed, 10 insertions, 6 deletions
diff --git a/src/view/com/lightbox/ImageViewing/@types/index.ts b/src/view/com/lightbox/ImageViewing/@types/index.ts index 4a08e2394..8400e12e4 100644 --- a/src/view/com/lightbox/ImageViewing/@types/index.ts +++ b/src/view/com/lightbox/ImageViewing/@types/index.ts @@ -6,8 +6,6 @@ * */ -import {ImageURISource, ImageRequireSource} from 'react-native' - export type Dimensions = { width: number height: number @@ -18,4 +16,4 @@ export type Position = { y: number } -export type ImageSource = ImageURISource | ImageRequireSource +export type ImageSource = {uri: string; alt?: string} diff --git a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx index 01a53ff6f..b900f9afe 100644 --- a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx +++ b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx @@ -133,6 +133,8 @@ const ImageItem = ({ source={imageSrc} style={imageStylesWithOpacity} onLoad={onLoaded} + accessibilityLabel={imageSrc.alt} + accessibilityHint="" /> {(!isLoaded || !imageDimensions) && <ImageLoading />} </ScrollView> diff --git a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx index 658735724..ebf0b1d28 100644 --- a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx +++ b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx @@ -128,7 +128,9 @@ const ImageItem = ({ onPress={doubleTapToZoomEnabled ? handleDoubleTap : undefined} onLongPress={onLongPressHandler} delayLongPress={delayLongPress} - accessibilityRole="image"> + accessibilityRole="image" + accessibilityLabel={imageSrc.alt} + accessibilityHint=""> <Animated.Image source={imageSrc} style={imageStylesWithOpacity} diff --git a/src/view/com/lightbox/Lightbox.tsx b/src/view/com/lightbox/Lightbox.tsx index b496e0d95..072bfebfa 100644 --- a/src/view/com/lightbox/Lightbox.tsx +++ b/src/view/com/lightbox/Lightbox.tsx @@ -109,7 +109,7 @@ export const Lightbox = observer(function Lightbox() { const opts = store.shell.activeLightbox as models.ProfileImageLightbox return ( <ImageView - images={[{uri: opts.profileView.avatar}]} + images={[{uri: opts.profileView.avatar || ''}]} imageIndex={0} visible onRequestClose={onClose} @@ -120,7 +120,7 @@ export const Lightbox = observer(function Lightbox() { const opts = store.shell.activeLightbox as models.ImagesLightbox return ( <ImageView - images={opts.images.map(({uri}) => ({uri}))} + images={opts.images.map(img => ({...img}))} imageIndex={opts.index} visible onRequestClose={onClose} diff --git a/src/view/com/lightbox/Lightbox.web.tsx b/src/view/com/lightbox/Lightbox.web.tsx index f6aa26a3b..6d79dad36 100644 --- a/src/view/com/lightbox/Lightbox.web.tsx +++ b/src/view/com/lightbox/Lightbox.web.tsx @@ -109,6 +109,8 @@ function LightboxInner({ accessibilityIgnoresInvertColors source={imgs[index]} style={styles.image} + accessibilityLabel={imgs[index].alt} + accessibilityHint="" /> {canGoLeft && ( <TouchableOpacity |