Page MenuHomePhorge

D14237.1768798909.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D14237.1768798909.diff

diff --git a/native/media/camera-modal.react.js b/native/media/camera-modal.react.js
--- a/native/media/camera-modal.react.js
+++ b/native/media/camera-modal.react.js
@@ -176,25 +176,11 @@
+focusIndicatorStyle: ViewStyle,
+stagingModeProgress: SharedValue<number>,
+overlayStyle: ViewStyle,
+ +sendButtonProgress: Animated.Value,
+ +sendButtonStyle: ViewStyle,
};
class CameraModal extends React.PureComponent<Props> {
- sendButtonProgress: Animated.Value = new Animated.Value(0);
- sendButtonStyle: ViewStyle;
-
- constructor(props: Props) {
- super(props);
-
- const sendButtonScale = this.sendButtonProgress.interpolate({
- inputRange: [0, 1],
- outputRange: ([1.1, 1]: number[]), // Flow...
- });
- this.sendButtonStyle = {
- opacity: this.sendButtonProgress,
- transform: [{ scale: sendButtonScale }],
- };
- }
-
componentDidUpdate(prevProps: Props) {
if (this.props.deviceOrientation !== prevProps.deviceOrientation) {
this.props.setAutoFocusPointOfInterest(null);
@@ -220,7 +206,7 @@
}
if (this.props.pendingPhotoCapture && !prevProps.pendingPhotoCapture) {
- Animated.timing(this.sendButtonProgress, {
+ Animated.timing(this.props.sendButtonProgress, {
...sendButtonAnimationConfig,
toValue: 1,
}).start();
@@ -229,7 +215,7 @@
prevProps.pendingPhotoCapture
) {
void cleanUpPendingPhotoCapture(prevProps.pendingPhotoCapture);
- this.sendButtonProgress.setValue(0);
+ this.props.sendButtonProgress.setValue(0);
}
}
@@ -301,7 +287,7 @@
onPress={this.props.sendPhoto}
pointerEvents={pendingPhotoCapture ? 'auto' : 'none'}
containerStyle={styles.sendButtonContainer}
- style={this.sendButtonStyle}
+ style={this.props.sendButtonStyle}
/>
</View>
</SafeAreaView>
@@ -899,6 +885,7 @@
const isOutsideFlashButton = isOutsideButton(
flashButtonDimensions.value,
);
+
return (
isOutsideCloseButton &&
isOutsidePhotoButton &&
@@ -1055,6 +1042,19 @@
[overlayAnimatedStyle],
);
+ const sendButtonProgress = React.useRef(new Animated.Value(0));
+
+ const sendButtonStyle = React.useMemo(() => {
+ const sendButtonScale = sendButtonProgress.current.interpolate({
+ inputRange: [0, 1],
+ outputRange: ([1.1, 1]: number[]), // Flow...
+ });
+ return {
+ opacity: sendButtonProgress.current,
+ transform: [{ scale: sendButtonScale }],
+ };
+ }, []);
+
return (
<CameraModal
{...props}
@@ -1098,6 +1098,8 @@
focusIndicatorStyle={focusIndicatorStyle}
stagingModeProgress={stagingModeProgress}
overlayStyle={overlayStyle}
+ sendButtonProgress={sendButtonProgress.current}
+ sendButtonStyle={sendButtonStyle}
/>
);
});

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 19, 5:01 AM (7 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5954482
Default Alt Text
D14237.1768798909.diff (2 KB)

Event Timeline