Page MenuHomePhabricator

D14123.id46516.diff
No OneTemporary

D14123.id46516.diff

diff --git a/native/chat/inline-engagement.react.js b/native/chat/inline-engagement.react.js
--- a/native/chat/inline-engagement.react.js
+++ b/native/chat/inline-engagement.react.js
@@ -6,7 +6,9 @@
import { Text, View } from 'react-native';
import Animated, {
Extrapolate,
- interpolateNode,
+ type SharedValue,
+ useAnimatedStyle,
+ interpolate,
} from 'react-native-reanimated';
import type { ReactionInfo } from 'lib/selectors/chat-selectors.js';
@@ -463,7 +465,7 @@
type TooltipInlineEngagementProps = {
+item: ChatComposedMessageInfoItemWithHeight,
+isOpeningSidebar: boolean,
- +progress: Animated.Node,
+ +progressV2: SharedValue<number>,
+windowWidth: number,
+positioning: 'left' | 'right' | 'center',
+initialCoordinates: {
@@ -480,7 +482,7 @@
const {
item,
isOpeningSidebar,
- progress,
+ progressV2,
windowWidth,
initialCoordinates,
positioning,
@@ -504,14 +506,10 @@
`${positioning} is not a valid positioning value for TooltipInlineEngagement`,
);
}, [positioning]);
- const inlineEngagementContainer = React.useMemo(() => {
+ const inlineEngagementContainer = useAnimatedStyle(() => {
const opacity = isOpeningSidebar
? 0
- : interpolateNode(progress, {
- inputRange: [0, 1],
- outputRange: [1, 0],
- extrapolate: Extrapolate.CLAMP,
- });
+ : interpolate(progressV2.value, [0, 1], [1, 0], Extrapolate.CLAMP);
return {
position: 'absolute',
width: windowWidth,
@@ -523,7 +521,6 @@
initialCoordinates.height,
initialCoordinates.x,
isOpeningSidebar,
- progress,
windowWidth,
]);
return (
diff --git a/native/chat/multimedia-message-tooltip-button.react.js b/native/chat/multimedia-message-tooltip-button.react.js
--- a/native/chat/multimedia-message-tooltip-button.react.js
+++ b/native/chat/multimedia-message-tooltip-button.react.js
@@ -81,12 +81,12 @@
item={item}
positioning={item.messageInfo.creator.isViewer ? 'right' : 'left'}
isOpeningSidebar={isOpeningSidebar}
- progress={progress}
+ progressV2={progressV2}
windowWidth={windowWidth}
initialCoordinates={initialCoordinates}
/>
);
- }, [initialCoordinates, isOpeningSidebar, item, progress, windowWidth]);
+ }, [initialCoordinates, isOpeningSidebar, item, progressV2, windowWidth]);
const innerMultimediaMessage = React.useMemo(
() => (
diff --git a/native/chat/text-message-tooltip-button.react.js b/native/chat/text-message-tooltip-button.react.js
--- a/native/chat/text-message-tooltip-button.react.js
+++ b/native/chat/text-message-tooltip-button.react.js
@@ -40,7 +40,7 @@
+isOpeningSidebar: boolean,
};
function TextMessageTooltipButton(props: Props): React.Node {
- const { navigation, route, progress, progressV2, isOpeningSidebar } = props;
+ const { navigation, route, progressV2, isOpeningSidebar } = props;
const windowWidth = useSelector(state => state.dimensions.width);
@@ -97,12 +97,12 @@
item={item}
positioning={item.messageInfo.creator.isViewer ? 'right' : 'left'}
isOpeningSidebar={isOpeningSidebar}
- progress={progress}
+ progressV2={progressV2}
windowWidth={windowWidth}
initialCoordinates={initialCoordinates}
/>
);
- }, [initialCoordinates, isOpeningSidebar, item, progress, windowWidth]);
+ }, [initialCoordinates, isOpeningSidebar, item, progressV2, windowWidth]);
const { messageInfo, threadInfo, reactions } = item;

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 2:57 AM (7 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2682096
Default Alt Text
D14123.id46516.diff (3 KB)

Event Timeline