Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3493346
D14119.id46413.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14119.id46413.diff
View Options
diff --git a/native/chat/utils.js b/native/chat/utils.js
--- a/native/chat/utils.js
+++ b/native/chat/utils.js
@@ -2,7 +2,11 @@
import invariant from 'invariant';
import * as React from 'react';
-import Animated, { type SharedValue } from 'react-native-reanimated';
+import Animated, {
+ type SharedValue,
+ interpolate,
+ useAnimatedStyle,
+} from 'react-native-reanimated';
import { useLoggedInUserInfo } from 'lib/hooks/account-hooks.js';
import { useThreadChatMentionCandidates } from 'lib/hooks/chat-mention-hooks.js';
@@ -187,6 +191,7 @@
initialCoordinates,
messageListVerticalBounds,
progress,
+ progressV2,
targetInputBarHeight,
}: AnimatedMessageArgs): {
+style: AnimatedViewStyle,
@@ -246,16 +251,6 @@
return () => setCurrentTransitionSidebarSourceID(null);
}, [setCurrentTransitionSidebarSourceID]);
- const bottom = React.useMemo(
- () =>
- interpolateNode(progress, {
- inputRange: [0.3, 1],
- outputRange: [targetPosition, 0],
- extrapolate: Extrapolate.CLAMP,
- }),
- [progress, targetPosition],
- );
-
const [isThreadColorDarkOverride, setThreadColorDarkOverride] =
React.useState<?boolean>(null);
const setThreadColorBrightness = React.useCallback(() => {
@@ -292,7 +287,13 @@
targetColor,
]);
- const messageContainerStyle = React.useMemo(() => {
+ const messageContainerStyle = useAnimatedStyle(() => {
+ const bottom = interpolate(
+ progressV2.value,
+ [0.3, 1],
+ [targetPosition, 0],
+ Extrapolate.CLAMP,
+ );
return {
bottom: currentTransitionSidebarSourceID ? bottom : 0,
opacity:
@@ -301,7 +302,7 @@
? 0
: 1,
};
- }, [bottom, currentTransitionSidebarSourceID, sidebarAnimationType]);
+ }, [currentTransitionSidebarSourceID, sidebarAnimationType]);
return {
style: messageContainerStyle,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 2:56 AM (20 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2677171
Default Alt Text
D14119.id46413.diff (1 KB)
Attached To
Mode
D14119: [native] Migrate messageContainerStyle in useAnimatedMessageTooltipButton to Reanimate V2 API
Attached
Detach File
Event Timeline
Log In to Comment