From ed6aa121bbc12f15432d6f867abda81eb14bc382 Mon Sep 17 00:00:00 2001 From: vineyardbovines Date: Tue, 31 Mar 2026 15:21:31 -0400 Subject: [PATCH] fix reversion --- src/components/Post/Embed/ImageEmbed.tsx | 4 +- src/components/images/Gallery.tsx | 126 ---------------------- src/components/images/ImageLayoutGrid.tsx | 2 +- 3 files changed, 3 insertions(+), 129 deletions(-) delete mode 100644 src/components/images/Gallery.tsx diff --git a/src/components/Post/Embed/ImageEmbed.tsx b/src/components/Post/Embed/ImageEmbed.tsx index a3f0d46377..5934eac3ee 100644 --- a/src/components/Post/Embed/ImageEmbed.tsx +++ b/src/components/Post/Embed/ImageEmbed.tsx @@ -12,7 +12,7 @@ import {useLightboxControls} from '#/state/lightbox' import {type Dimensions} from '#/view/com/lightbox/ImageViewing/@types' import {atoms as a} from '#/alf' import {AutoSizedImage} from '#/components/images/AutoSizedImage' -import {ImageLayoutGrid} from '#/components/images/ImageLayoutGrid' +import {Gallery} from '#/components/images/Gallery' import {PostEmbedViewContext} from '#/components/Post/Embed/types' import {type EmbedType} from '#/types/bsky/post' import {type CommonProps} from './types' @@ -97,7 +97,7 @@ export function ImageEmbed({ return ( - void - -interface Props { - images: AppBskyEmbedImages.ViewImage[] - index: number - onPress?: ( - index: number, - containerRefs: AnimatedRef[], - fetchedDims: (Dimensions | null)[], - ) => void - onLongPress?: EventFunction - onPressIn?: EventFunction - imageStyle?: StyleProp - viewContext?: PostEmbedViewContext - insetBorderStyle?: StyleProp - containerRefs: AnimatedRef[] - thumbDimsRef: React.RefObject<(Dimensions | null)[]> -} - -export function GalleryItem({ - images, - index, - imageStyle, - onPress, - onPressIn, - onLongPress, - viewContext, - insetBorderStyle, - containerRefs, - thumbDimsRef, -}: Props) { - const t = useTheme() - const {_} = useLingui() - const largeAltBadge = useLargeAltBadgeEnabled() - const image = images[index] - const hasAlt = !!image.alt - const hideBadges = - viewContext === PostEmbedViewContext.FeedEmbedRecordWithMedia - return ( - - onPress(index, containerRefs, thumbDimsRef.current.slice()) - : undefined - } - onPressIn={onPressIn ? () => onPressIn(index) : undefined} - onLongPress={onLongPress ? () => onLongPress(index) : undefined} - android_ripple={{ - color: utils.alpha(t.atoms.bg.backgroundColor, 0.2), - foreground: true, - }} - style={[ - a.flex_1, - a.overflow_hidden, - t.atoms.bg_contrast_25, - imageStyle, - ]} - accessibilityRole="button" - accessibilityLabel={image.alt || _(msg`Image`)} - accessibilityHint=""> - { - thumbDimsRef.current[index] = { - width: e.source.width, - height: e.source.height, - } - }} - loading="lazy" - /> - - - {hasAlt && !hideBadges ? ( - - - ALT - - - ) : null} - - ) -} diff --git a/src/components/images/ImageLayoutGrid.tsx b/src/components/images/ImageLayoutGrid.tsx index 54ee1e0121..b2be80b881 100644 --- a/src/components/images/ImageLayoutGrid.tsx +++ b/src/components/images/ImageLayoutGrid.tsx @@ -6,7 +6,7 @@ import {type AppBskyEmbedImages} from '@atproto/api' import {type Dimensions} from '#/view/com/lightbox/ImageViewing/@types' import {atoms as a, useBreakpoints} from '#/alf' import {PostEmbedViewContext} from '#/components/Post/Embed/types' -import {GalleryItem} from './Gallery' +import {GalleryItem} from './Gallery/GalleryItem' interface ImageLayoutGridProps { images: AppBskyEmbedImages.ViewImage[]