From 22fee3b2278ceecaad05a58e8102e74d090edd3e Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Mon, 5 Feb 2024 13:04:35 +1000 Subject: [PATCH 1/2] Remove opacity when media is being uploaded --- .../src/mobile/image/index.native.js | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/packages/components/src/mobile/image/index.native.js b/packages/components/src/mobile/image/index.native.js index 0b9588eb3ac8ac..aec8f94d1b5088 100644 --- a/packages/components/src/mobile/image/index.native.js +++ b/packages/components/src/mobile/image/index.native.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Animated, Image as RNImage, Text, View } from 'react-native'; +import { Image as RNImage, Text, View } from 'react-native'; import FastImage from 'react-native-fast-image'; /** @@ -11,7 +11,7 @@ import { __ } from '@wordpress/i18n'; import { Icon } from '@wordpress/components'; import { image, offline } from '@wordpress/icons'; import { usePreferredColorSchemeStyle } from '@wordpress/compose'; -import { useEffect, useState, useRef, Platform } from '@wordpress/element'; +import { useEffect, useState, Platform } from '@wordpress/element'; /** * Internal dependencies @@ -218,19 +218,8 @@ const ImageComponent = ( { focalPoint && styles.focalPointContainer, ]; - const opacityValue = useRef( new Animated.Value( 1 ) ).current; - - useEffect( () => { - Animated.timing( opacityValue, { - toValue: isUploadInProgress ? 0.3 : 1, - duration: 100, - useNativeDriver: true, - } ).start(); - }, [ isUploadInProgress, opacityValue ] ); - const imageStyles = [ { - opacity: opacityValue, height: containerSize?.height, }, ! resizeMode && { @@ -319,7 +308,7 @@ const ImageComponent = ( { { Platform.isAndroid && ( <> { networkImageLoaded && networkURL && ( - ) } { ! networkImageLoaded && ! networkURL && ( - - Date: Thu, 22 Feb 2024 15:35:12 +1000 Subject: [PATCH 2/2] Update CHANGELOG --- packages/react-native-editor/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native-editor/CHANGELOG.md b/packages/react-native-editor/CHANGELOG.md index ecd7457c3f1ed9..ab8fa29d10e723 100644 --- a/packages/react-native-editor/CHANGELOG.md +++ b/packages/react-native-editor/CHANGELOG.md @@ -11,6 +11,7 @@ For each user feature we should also add a importance categorization label to i ## Unreleased - [*] Prevent crash when autoscrolling to blocks [#59110] +- [*] Remove opacity change when images are being uploaded [#59264] ## 1.112.0 - [*] [internal] Upgrade React Native to version 0.71.15 [#57667]