From 81b5cdffd10b867348f87f173b50a963ac9f6185 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 14 Apr 2026 16:12:04 -0500 Subject: [PATCH] Add a11y state --- src/components/images/Gallery/const.ts | 2 -- src/components/images/Gallery/index.tsx | 31 ++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/components/images/Gallery/const.ts b/src/components/images/Gallery/const.ts index 2c388a4534..9dc1d8664a 100644 --- a/src/components/images/Gallery/const.ts +++ b/src/components/images/Gallery/const.ts @@ -1,3 +1 @@ -export const CONTAINER_ASPECT_RATIO = 3 / 2 export const ITEM_GAP = 8 // tokens.space.sm -export const MIN_PEEK = 40 diff --git a/src/components/images/Gallery/index.tsx b/src/components/images/Gallery/index.tsx index 06b06d60eb..f532a467f9 100644 --- a/src/components/images/Gallery/index.tsx +++ b/src/components/images/Gallery/index.tsx @@ -28,7 +28,7 @@ import {useAnalytics} from '#/analytics' import {BlockDrawerGesture} from '#/view/shell/BlockDrawerGesture' import {useKeyboardHandlers} from '#/components/images/Gallery/useKeyboardHandlers' import {usePointerHandlers} from '#/components/images/Gallery/usePointerHandlers' -import {CONTAINER_ASPECT_RATIO, ITEM_GAP, MIN_PEEK} from '#/components/images/Gallery/const' +import {ITEM_GAP} from '#/components/images/Gallery/const' import {IS_WEB} from '#/env' interface GalleryProps { @@ -84,8 +84,6 @@ export function Gallery({ onPressIn, viewContext, }: GalleryProps) { - const t = useTheme() - const {t: l} = useLingui() const ax = useAnalytics() const {screenReaderEnabled} = useA11y() const largeAltBadge = useLargeAltBadgeEnabled() @@ -179,6 +177,33 @@ export function Gallery({ imageCount: images.length, }) + if (screenReaderEnabled) { + return ( + + {images.map((image, index) => ( + + onPress?.(index, [containerRef], [dims]) + } + onPressIn={() => onPressIn?.(index)} + hideBadge={ + viewContext === PostEmbedViewContext.FeedEmbedRecordWithMedia + } + /> + ))} + + ) + } + return (