Page MenuHomePhabricator

D5452.diff
No OneTemporary

D5452.diff

diff --git a/native/chat/multimedia-message.react.js b/native/chat/multimedia-message.react.js
--- a/native/chat/multimedia-message.react.js
+++ b/native/chat/multimedia-message.react.js
@@ -143,13 +143,11 @@
const aboveMargin = isViewer ? 30 : 50;
const aboveSpace = tooltipHeight + aboveMargin;
- let location = 'below',
- margin = belowMargin;
+ let margin = belowMargin;
if (
multimediaBottom + belowSpace > boundsBottom &&
multimediaTop - aboveSpace > boundsTop
) {
- location = 'above';
margin = aboveMargin;
}
@@ -160,7 +158,6 @@
item,
initialCoordinates: coordinates,
verticalBounds,
- location,
margin,
visibleEntryIDs,
},
diff --git a/native/chat/robotext-message.react.js b/native/chat/robotext-message.react.js
--- a/native/chat/robotext-message.react.js
+++ b/native/chat/robotext-message.react.js
@@ -103,13 +103,11 @@
const aboveMargin = isViewer ? 30 : 50;
const aboveSpace = tooltipHeight + aboveMargin;
- let location = 'below',
- margin = 0;
+ let margin = 0;
if (
messageBottom + belowSpace > boundsBottom &&
messageTop - aboveSpace > boundsTop
) {
- location = 'above';
margin = aboveMargin;
}
@@ -120,7 +118,6 @@
initialCoordinates: coordinates,
verticalBounds,
visibleEntryIDs,
- location,
margin,
item,
},
diff --git a/native/chat/text-message.react.js b/native/chat/text-message.react.js
--- a/native/chat/text-message.react.js
+++ b/native/chat/text-message.react.js
@@ -170,13 +170,11 @@
const aboveMargin = isViewer ? 30 : 50;
const aboveSpace = tooltipHeight + aboveMargin;
- let location = 'below',
- margin = belowMargin;
+ let margin = belowMargin;
if (
messageBottom + belowSpace > boundsBottom &&
messageTop - aboveSpace > boundsTop
) {
- location = 'above';
margin = aboveMargin;
}
@@ -187,7 +185,6 @@
initialCoordinates: coordinates,
verticalBounds,
visibleEntryIDs,
- location,
margin,
item,
},
diff --git a/native/navigation/tooltip.react.js b/native/navigation/tooltip.react.js
--- a/native/navigation/tooltip.react.js
+++ b/native/navigation/tooltip.react.js
@@ -77,7 +77,6 @@
+presentedFrom: string,
+initialCoordinates: LayoutCoordinates,
+verticalBounds: VerticalBounds,
- +location?: 'above' | 'below',
+margin?: number,
+visibleEntryIDs?: $ReadOnlyArray<string>,
};
@@ -226,32 +225,6 @@
return tooltipHeight;
}
- get location(): 'above' | 'below' {
- const { params } = this.props.route;
- const { location } = params;
- if (location) {
- return location;
- }
-
- const { initialCoordinates, verticalBounds } = params;
- const { y, height } = initialCoordinates;
- const contentTop = y;
- const contentBottom = y + height;
- const boundsTop = verticalBounds.y;
- const boundsBottom = verticalBounds.y + verticalBounds.height;
-
- const { margin, tooltipHeight: curTooltipHeight } = this;
- const fullHeight = curTooltipHeight + margin;
- if (
- contentBottom + fullHeight > boundsBottom &&
- contentTop - fullHeight > boundsTop
- ) {
- return 'above';
- }
-
- return 'below';
- }
-
get opacityStyle() {
return {
...styles.backdrop,
@@ -295,7 +268,7 @@
const { dimensions, route } = this.props;
const { initialCoordinates, verticalBounds } = route.params;
const { x, y, width, height } = initialCoordinates;
- const { margin, location } = this;
+ const { margin } = this;
const style = {};
style.position = 'absolute';
@@ -312,17 +285,9 @@
}
style.minWidth = dimensions.width - 16;
- if (location === 'above') {
- const fullScreenHeight = dimensions.height;
- style.bottom =
- fullScreenHeight - Math.max(y, verticalBounds.y) + margin;
- style.transform.push({ translateY: this.tooltipVerticalAbove });
- } else {
- style.top =
- Math.min(y + height, verticalBounds.y + verticalBounds.height) +
- margin;
- style.transform.push({ translateY: this.tooltipVerticalBelow });
- }
+ style.top =
+ Math.min(y + height, verticalBounds.y + verticalBounds.height) + margin;
+ style.transform.push({ translateY: this.tooltipVerticalBelow });
style.transform.push({ scale: this.tooltipScale });

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 5:39 AM (14 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2569222
Default Alt Text
D5452.diff (4 KB)

Event Timeline