Pass thumbnail ref through peek commit so lightbox return animates
The lightbox's close animation needs the original thumbnail ref/dims to know where to animate back to. The peek-commit path was passing null, so the lightbox dropped to a fade instead of the usual return-to-thumb animation. Rework each embed path so the tap handler and the peek-commit handler invoke the same openLightbox call with the same ref + dims: - Grid and scrollable Gallery: derive `openLightboxAtIndex` once per cell and hand it to both Pressable.onPress and ContextMenu.onPreviewPress. - Single image: add onContainerRef / onDimsChange callbacks to AutoSizedImage, capture them in ImageEmbed, and use them for the peek commit. Drops the now-redundant onPreviewPress prop chain. https://claude.ai/code/session_015REmux3R9uuEMMJUHxTyQT
This commit is contained in:
@@ -17,7 +17,6 @@ interface ImageLayoutGridProps {
|
||||
) => void
|
||||
onLongPress?: (index: number) => void
|
||||
onPressIn?: (index: number) => void
|
||||
onPreviewPress?: (index: number) => void
|
||||
style?: StyleProp<ViewStyle>
|
||||
viewContext?: PostEmbedViewContext
|
||||
}
|
||||
@@ -49,7 +48,6 @@ interface ImageLayoutGridInnerProps {
|
||||
) => void
|
||||
onLongPress?: (index: number) => void
|
||||
onPressIn?: (index: number) => void
|
||||
onPreviewPress?: (index: number) => void
|
||||
viewContext?: PostEmbedViewContext
|
||||
gap: {gap: number}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user