about summary refs log tree commit diff
path: root/src/view/com/lightbox/ImageViewing/hooks/useImageDimensions.ts
Commit message (Collapse)AuthorAgeFilesLines
* Unify dimensions cache between lightbox and feed (#6047)dan2024-11-041-93/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove useless memo * Use explicit values when useImageAspectRatio doesn't know It's not very good that you can't distingiush when we haven't loaded vs when we're certain. This shifts the burden of dealing with missing values to the caller. * Check cache early * Handle src change * Rewrite image-sizes.fetch to avoid mixing async styles * Make image-sizes LRU Code is copy paste from useImageDimensions.ts * Rm unused fields * Derive aspect on the fly * Factor useImageDimensions out of useImageAspectRatio * Move useImageDimensions into image-sizes * Make lightbox use the same cache * Wire up known dimensions to the lightbox * Handle division by zero in the hook * Use safe aspect for lightbox calculations
* Show almost-instant preview when opening lightbox (#6000)dan2024-10-291-6/+12
| | | | | | | | | | | * Plumb thumbUri down to the lightbox * Remove onLoad tracking from lightbox * Hook up placeholder URI to the image * Fix NaN causing crash on double tap while offline * Protect against NaNs in the future
* Drive-by lightbox refactors (#1659)dan2023-10-101-19/+0
| | | | | | | * Remove dead code from lightbox * Rename imageIndex prop to initialImageIndex * Rename currentImageIndex to imageIndex
* Remove unused lightbox options (#1616)dan2023-10-051-2/+20
| | | | | | | | | | | | | | | | | | | | | | | * Inline lightbox helpers * Delete unused useImagePrefetch * Delete unused long press gesture * Always enable double tap * Always enable swipe to close * Remove unused onImageIndexChange * Inline custom Hooks into ImageViewing * Declare LightboxFooter outside Lightbox * Add more TODO comments * Inline useDoubleTapToZoom * Remove dead utils, move utils used only once
* Fix all type errorsPaul Frazee2023-01-261-1/+1
|
* Saves image on long press (#83)Aryan Goharzad2023-01-251-0/+88
* Saves image on long press * Adds save on long press * Forking lightbox * move to wrapper only to the bottom sheet to reduce impact of this change * lint * lint * lint * Use official `share` API * Clean up cache after download * comment * comment * Reduce swipe close velocity * Updates per feedback * lint * bugfix * Adds delayed press-in for TouchableOpacity