diff options
author | dan <dan.abramov@gmail.com> | 2023-10-09 22:29:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-09 22:29:56 +0100 |
commit | ce0f79600870d373bd8289c13f4efb44b253ffb1 (patch) | |
tree | fbe87a75d96c3d535fae067ff2b16e82c8a340d6 /src | |
parent | b12cfbe90b69d0ec1327c92a1e898be629ebf06b (diff) | |
download | voidsky-ce0f79600870d373bd8289c13f4efb44b253ffb1.tar.zst |
Remove unnecessary opacity logic (#1646)
Diffstat (limited to 'src')
-rw-r--r-- | src/view/com/lightbox/ImageViewing/index.tsx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/view/com/lightbox/ImageViewing/index.tsx b/src/view/com/lightbox/ImageViewing/index.tsx index bc2a8a448..b6b321c4a 100644 --- a/src/view/com/lightbox/ImageViewing/index.tsx +++ b/src/view/com/lightbox/ImageViewing/index.tsx @@ -71,7 +71,6 @@ function ImageViewing({ const imageList = useRef<VirtualizedList<ImageSource>>(null) const [isScaled, setIsScaled] = useState(false) const [isDragging, setIsDragging] = useState(false) - const [opacity, setOpacity] = useState(1) const [currentImageIndex, setImageIndex] = useState(imageIndex) const [headerTranslate] = useState( () => new Animated.ValueXY(INITIAL_POSITION), @@ -100,12 +99,6 @@ function ImageViewing({ } } - const onRequestCloseEnhanced = () => { - setOpacity(0) - onRequestClose() - setTimeout(() => setOpacity(1), 0) - } - const onScroll = (event: NativeSyntheticEvent<NativeScrollEvent>) => { const { nativeEvent: { @@ -162,14 +155,14 @@ function ImageViewing({ aria-modal accessibilityViewIsModal> <ModalsContainer /> - <View style={[styles.container, {opacity, backgroundColor}]}> + <View style={[styles.container, {backgroundColor}]}> <Animated.View style={[styles.header, {transform: headerTransform}]}> {typeof HeaderComponent !== 'undefined' ? ( React.createElement(HeaderComponent, { imageIndex: currentImageIndex, }) ) : ( - <ImageDefaultHeader onRequestClose={onRequestCloseEnhanced} /> + <ImageDefaultHeader onRequestClose={onRequestClose} /> )} </Animated.View> <VirtualizedList @@ -191,7 +184,7 @@ function ImageViewing({ <ImageItem onZoom={onZoom} imageSrc={imageSrc} - onRequestClose={onRequestCloseEnhanced} + onRequestClose={onRequestClose} pinchGestureRef={pinchGestureRefs.get(imageSrc)} isScrollViewBeingDragged={isDragging} /> |