Page MenuHomePhabricator

D12977.id43112.diff
No OneTemporary

D12977.id43112.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
@@ -6,10 +6,7 @@
import Animated from 'react-native-reanimated';
import type { AppNavigationProp } from '../navigation/app-navigator.react.js';
-import {
- OverlayContext,
- type OverlayContextType,
-} from '../navigation/overlay-context.js';
+import { OverlayContext } from '../navigation/overlay-context.js';
import type { NavigationRoute } from '../navigation/route-names.js';
import { type DimensionsInfo } from '../redux/dimensions-updater.react.js';
import { useSelector } from '../redux/redux-utils.js';
@@ -83,7 +80,7 @@
...Base,
// Redux state
+dimensions: DimensionsInfo,
- +overlayContext: ?OverlayContextType,
+ +position: Animated.Node,
+styles: $ReadOnly<typeof unboundStyles>,
+closeTip: () => mixed,
+contentContainerStyle: ViewStyle,
@@ -110,9 +107,7 @@
constructor(props: NUXTipsOverlayProps<BaseNUXTipsOverlayProps>) {
super(props);
- const { overlayContext } = props;
- invariant(overlayContext, 'NUXTipsOverlay should have OverlayContext');
- const { position } = overlayContext;
+ const { position } = props;
this.backdropOpacity = interpolateNode(position, {
inputRange: [0, 1],
@@ -209,7 +204,7 @@
render(): React.Node {
const {
dimensions,
- overlayContext,
+ position,
styles,
closeTip,
contentContainerStyle,
@@ -236,9 +231,6 @@
const triangleUp = <View style={[styles.triangleUp, triangleStyle]} />;
- invariant(overlayContext, 'NUXTipsOverlay should have OverlayContext');
- const { position } = overlayContext;
-
const buttonProps: ButtonProps<BaseNUXTipsOverlayProps> = {
...navAndRouteForFlow,
progress: position,
@@ -294,6 +286,8 @@
function ConnectedNUXTipsOverlay(props: BaseNUXTipsOverlayProps) {
const dimensions = useSelector(state => state.dimensions);
const overlayContext = React.useContext(OverlayContext);
+ invariant(overlayContext, 'NUXTipsOverlay should have OverlayContext');
+ const { position } = overlayContext;
const { goBackOnce } = props.navigation;
@@ -316,7 +310,7 @@
<NUXTipsOverlay
{...props}
dimensions={dimensions}
- overlayContext={overlayContext}
+ position={position}
styles={styles}
closeTip={goBackOnce}
contentContainerStyle={contentContainerStyle}

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 6:05 AM (18 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2684323
Default Alt Text
D12977.id43112.diff (2 KB)

Event Timeline