Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2769138
D12979.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12979.diff
View Options
diff --git a/native/tooltip/nux-tips-overlay.react.js b/native/tooltip/nux-tips-overlay.react.js
--- a/native/tooltip/nux-tips-overlay.react.js
+++ b/native/tooltip/nux-tips-overlay.react.js
@@ -85,6 +85,7 @@
+closeTip: () => mixed,
+contentContainerStyle: ViewStyle,
+opacityStyle: AnimatedViewStyle,
+ +buttonStyle: ViewStyle,
};
function createNUXTipsOverlay(
@@ -143,18 +144,6 @@
);
}
- get buttonStyle(): ViewStyle {
- const { params } = this.props.route;
- const { initialCoordinates, verticalBounds } = params;
- const { x, y, width, height } = initialCoordinates;
- return {
- width: Math.ceil(width),
- height: Math.ceil(height),
- marginTop: y - verticalBounds.y,
- marginLeft: x,
- };
- }
-
get tipContainerStyle(): AnimatedViewStyle {
const { dimensions, route } = this.props;
const { initialCoordinates, verticalBounds } = route.params;
@@ -197,6 +186,7 @@
closeTip,
contentContainerStyle,
opacityStyle,
+ buttonStyle,
...navAndRouteForFlow
} = this.props;
@@ -244,7 +234,7 @@
<View style={styles.container}>
<AnimatedView style={opacityStyle} />
<View style={this.props.contentContainerStyle}>
- <View style={this.buttonStyle}>
+ <View style={buttonStyle}>
<ButtonComponent {...buttonProps} />
</View>
</View>
@@ -307,6 +297,18 @@
};
}, [position, styles.backdrop]);
+ const { initialCoordinates, verticalBounds } = props.route.params;
+
+ const buttonStyle = React.useMemo(() => {
+ const { x, y, width, height } = initialCoordinates;
+ return {
+ width: Math.ceil(width),
+ height: Math.ceil(height),
+ marginTop: y - verticalBounds.y,
+ marginLeft: x,
+ };
+ }, [initialCoordinates, verticalBounds]);
+
return (
<NUXTipsOverlay
{...props}
@@ -316,6 +318,7 @@
closeTip={goBackOnce}
contentContainerStyle={contentContainerStyle}
opacityStyle={opacityStyle}
+ buttonStyle={buttonStyle}
/>
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 20, 6:19 PM (21 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2153228
Default Alt Text
D12979.diff (2 KB)
Attached To
Mode
D12979: [native] Move buttonStyle
Attached
Detach File
Event Timeline
Log In to Comment