Page MenuHomePhabricator

D5381.id17629.diff
No OneTemporary

D5381.id17629.diff

diff --git a/native/chat/multimedia-message-tooltip-modal.react.js b/native/chat/multimedia-message-tooltip-modal.react.js
--- a/native/chat/multimedia-message-tooltip-modal.react.js
+++ b/native/chat/multimedia-message-tooltip-modal.react.js
@@ -46,8 +46,6 @@
spec,
);
-const multimediaMessageTooltipHeight: number = tooltipHeight(
- spec.entries.length,
-);
+const multimediaMessageTooltipHeight: number = tooltipHeight();
export { MultimediaMessageTooltipModal, multimediaMessageTooltipHeight };
diff --git a/native/chat/robotext-message-tooltip-modal.react.js b/native/chat/robotext-message-tooltip-modal.react.js
--- a/native/chat/robotext-message-tooltip-modal.react.js
+++ b/native/chat/robotext-message-tooltip-modal.react.js
@@ -38,6 +38,6 @@
spec,
);
-const robotextMessageTooltipHeight: number = tooltipHeight(spec.entries.length);
+const robotextMessageTooltipHeight: number = tooltipHeight();
export { RobotextMessageTooltipModal, robotextMessageTooltipHeight };
diff --git a/native/chat/text-message-tooltip-modal.react.js b/native/chat/text-message-tooltip-modal.react.js
--- a/native/chat/text-message-tooltip-modal.react.js
+++ b/native/chat/text-message-tooltip-modal.react.js
@@ -56,12 +56,12 @@
},
{
id: 'create_sidebar',
- text: 'Create thread',
+ text: 'Thread',
onPress: navigateToSidebar,
},
{
id: 'open_sidebar',
- text: 'Go to thread',
+ text: 'Thread',
onPress: navigateToSidebar,
},
],
@@ -71,6 +71,6 @@
BaseTooltipProps<'TextMessageTooltipModal'>,
> = createTooltip<'TextMessageTooltipModal'>(TextMessageTooltipButton, spec);
-const textMessageTooltipHeight: number = tooltipHeight(spec.entries.length);
+const textMessageTooltipHeight: number = tooltipHeight();
export { TextMessageTooltipModal, textMessageTooltipHeight };
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
@@ -8,7 +8,6 @@
View,
StyleSheet,
TouchableWithoutFeedback,
- Platform,
TouchableOpacity,
} from 'react-native';
import Animated from 'react-native-reanimated';
@@ -227,7 +226,7 @@
}
get tooltipHeight(): number {
- return tooltipHeight(this.entries.length);
+ return tooltipHeight();
}
get location(): 'above' | 'below' {
@@ -310,12 +309,11 @@
const extraLeftSpace = x;
const extraRightSpace = dimensions.width - width - x;
if (extraLeftSpace < extraRightSpace) {
- style.left = 0;
- style.minWidth = width + 2 * extraLeftSpace;
+ style.left = 8;
} else {
- style.right = 0;
- style.minWidth = width + 2 * extraRightSpace;
+ style.right = 8;
}
+ style.minWidth = dimensions.width - 16;
if (location === 'above') {
const fullScreenHeight = dimensions.height;
@@ -361,33 +359,6 @@
);
});
- let triangleStyle;
- const { route } = this.props;
- const { initialCoordinates } = route.params;
- const { x, width } = initialCoordinates;
- const extraLeftSpace = x;
- const extraRightSpace = dimensions.width - width - x;
- if (extraLeftSpace < extraRightSpace) {
- triangleStyle = {
- alignSelf: 'flex-start',
- left: extraLeftSpace + (width - 20) / 2,
- };
- } else {
- triangleStyle = {
- alignSelf: 'flex-end',
- right: extraRightSpace + (width - 20) / 2,
- };
- }
-
- let triangleDown = null;
- let triangleUp = null;
- const { location } = this;
- if (location === 'above') {
- triangleDown = <View style={[styles.triangleDown, triangleStyle]} />;
- } else {
- triangleUp = <View style={[styles.triangleUp, triangleStyle]} />;
- }
-
invariant(overlayContext, 'Tooltip should have OverlayContext');
const { position } = overlayContext;
const isOpeningSidebar = !!chatContext?.currentTransitionSidebarSourceID;
@@ -411,9 +382,7 @@
style={this.tooltipContainerStyle}
onLayout={this.onTooltipContainerLayout}
>
- {triangleUp}
<View style={styles.items}>{items}</View>
- {triangleDown}
</AnimatedView>
</View>
</TouchableWithoutFeedback>
@@ -527,17 +496,19 @@
itemContainer: {
alignItems: 'center',
flex: 1,
- flexDirection: 'row',
+ flexDirection: 'column',
justifyContent: 'center',
padding: 10,
},
itemMargin: {
- borderBottomColor: '#E1E1E1',
- borderBottomWidth: 1,
+ borderRightColor: '#E1E1E1',
+ borderRightWidth: 1,
},
items: {
backgroundColor: 'white',
borderRadius: 5,
+ flex: 1,
+ flexDirection: 'row',
overflow: 'hidden',
},
label: {
@@ -546,39 +517,10 @@
lineHeight: 17,
textAlign: 'center',
},
- triangleDown: {
- borderBottomColor: 'transparent',
- borderBottomWidth: 0,
- borderLeftColor: 'transparent',
- borderLeftWidth: 10,
- borderRightColor: 'transparent',
- borderRightWidth: 10,
- borderStyle: 'solid',
- borderTopColor: 'white',
- borderTopWidth: 10,
- height: 10,
- top: Platform.OS === 'android' ? -1 : 0,
- width: 10,
- },
- triangleUp: {
- borderBottomColor: 'white',
- borderBottomWidth: 10,
- borderLeftColor: 'transparent',
- borderLeftWidth: 10,
- borderRightColor: 'transparent',
- borderRightWidth: 10,
- borderStyle: 'solid',
- borderTopColor: 'transparent',
- borderTopWidth: 0,
- bottom: Platform.OS === 'android' ? -1 : 0,
- height: 10,
- width: 10,
- },
});
-function tooltipHeight(numEntries: number): number {
- // 10 (triangle) + 37 * numEntries (entries) + numEntries - 1 (padding)
- return 9 + 38 * numEntries;
+function tooltipHeight(): number {
+ return 53;
}
export { createTooltip, tooltipHeight };

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 12:44 PM (1 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579819
Default Alt Text
D5381.id17629.diff (5 KB)

Event Timeline