Page MenuHomePhabricator

D12979.diff
No OneTemporary

D12979.diff

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

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)

Event Timeline