Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3515722
D14123.id46419.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D14123.id46419.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 9:49 AM (14 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2682096
Default Alt Text
D14123.id46419.diff (3 KB)
Attached To
Mode
D14123: [native] Migrate TooltipInlineEngagement to Reanimated V2 API
Attached
Detach File
Event Timeline
Log In to Comment