about summary refs log tree commit diff
path: root/src/view/com/lightbox/Lightbox.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-11-06 00:21:35 +0000
committerGitHub <noreply@github.com>2024-11-06 00:21:35 +0000
commit206df2ab801d211a412f9ce3694d90bdd053caaa (patch)
treee185c0694eba262c48bd08fc0f430dd0fb203a47 /src/view/com/lightbox/Lightbox.tsx
parent6b826fb88dd33fe594fd7bb631a90d1a1713d0df (diff)
downloadvoidsky-206df2ab801d211a412f9ce3694d90bdd053caaa.tar.zst
Remove SCREEN from lightbox layout (#6124)
* Assign an ID to lightbox and use it as a key

* Consolidate lightbox props into an object

* Remove unused prop

* Move SafeAreaView declaration

* Keep SafeAreaView always mounted

When exploring Android animation, I noticed its content jumps on the first frame. I think this should help prevent that.

* Pass safe area down for measurement

* Remove dependency on SCREEN in Android event handlers

* Remove dependency on SCREEN in iOS event handlers

* Remove dependency on SCREEN on iOS

* Remove dependency on SCREEN on Android

* Remove dependency on JS calc in controls

* Use flex for iOS layout
Diffstat (limited to 'src/view/com/lightbox/Lightbox.tsx')
-rw-r--r--src/view/com/lightbox/Lightbox.tsx9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/view/com/lightbox/Lightbox.tsx b/src/view/com/lightbox/Lightbox.tsx
index ed570d5a7..628bd2b9a 100644
--- a/src/view/com/lightbox/Lightbox.tsx
+++ b/src/view/com/lightbox/Lightbox.tsx
@@ -49,16 +49,9 @@ export function Lightbox() {
     [permissionResponse, requestPermission, _],
   )
 
-  if (!activeLightbox) {
-    return null
-  }
-
   return (
     <ImageView
-      images={activeLightbox.images}
-      initialImageIndex={activeLightbox.index}
-      thumbDims={activeLightbox.thumbDims}
-      visible
+      lightbox={activeLightbox}
       onRequestClose={onClose}
       onPressSave={saveImageToAlbumWithToasts}
       onPressShare={uri => shareImageModal({uri})}