Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNMobile] Remove opacity change when images are being uploaded #59264

Merged
merged 3 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions packages/components/src/mobile/image/index.native.js
Original file line number Diff line number Diff line change
@@ -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';

/**
Expand All @@ -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
Expand Down Expand Up @@ -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 && {
Expand Down Expand Up @@ -319,7 +308,7 @@ const ImageComponent = ( {
{ Platform.isAndroid && (
<>
{ networkImageLoaded && networkURL && (
<Animated.Image
<Image
style={ imageStyles }
fadeDuration={ 0 }
source={ { uri: networkURL } }
Expand All @@ -331,7 +320,7 @@ const ImageComponent = ( {
/>
) }
{ ! networkImageLoaded && ! networkURL && (
<Animated.Image
<Image
style={ imageStyles }
fadeDuration={ 0 }
source={ { uri: localURL } }
Expand All @@ -345,7 +334,7 @@ const ImageComponent = ( {
) }
{ Platform.isIOS && (
<>
<Animated.Image
<Image
style={ imageStyles }
source={ {
uri:
Expand Down
1 change: 1 addition & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Loading