From 477e5f4ecfaa0007aeed90b51274c78a730c1a9e Mon Sep 17 00:00:00 2001 From: hailey Date: Thu, 12 Jun 2025 10:46:22 -0700 Subject: new arch (#8295) Co-authored-by: Samuel Newman Co-authored-by: Charlotte Som Co-authored-by: Hailey --- src/view/com/util/post-embeds/index.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/view/com/util/post-embeds/index.tsx') diff --git a/src/view/com/util/post-embeds/index.tsx b/src/view/com/util/post-embeds/index.tsx index 431baa2b2..4cf71f948 100644 --- a/src/view/com/util/post-embeds/index.tsx +++ b/src/view/com/util/post-embeds/index.tsx @@ -7,6 +7,8 @@ import { type ViewStyle, } from 'react-native' import { + type AnimatedRef, + measure, type MeasuredDimensions, runOnJS, runOnUI, @@ -25,7 +27,6 @@ import { type ModerationDecision, } from '@atproto/api' -import {type HandleRef, measureHandle} from '#/lib/hooks/useHandleRef' import {usePalette} from '#/lib/hooks/usePalette' import {useLightboxControls} from '#/state/lightbox' import {useModerationOpts} from '#/state/preferences/moderation-opts' @@ -162,13 +163,15 @@ export function PostEmbeds({ } const onPress = ( index: number, - refs: HandleRef[], + refs: AnimatedRef[], fetchedDims: (Dimensions | null)[], ) => { - const handles = refs.map(r => r.current) runOnUI(() => { 'worklet' - const rects = handles.map(measureHandle) + const rects: (MeasuredDimensions | null)[] = [] + for (const r of refs) { + rects.push(measure(r)) + } runOnJS(_openLightbox)(index, rects, fetchedDims) })() } -- cgit 1.4.1