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 @@ -170,7 +170,7 @@ item, initialCoordinates: coordinates, verticalBounds, - location: 'fixed', + tooltipLocation: 'fixed', margin, visibleEntryIDs, chatInputBarHeight: currentInputBarHeight, 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 @@ -144,7 +144,7 @@ initialCoordinates: coordinates, verticalBounds, visibleEntryIDs, - location: 'fixed', + tooltipLocation: 'fixed', margin, item, chatInputBarHeight: currentInputBarHeight, 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 @@ -214,7 +214,7 @@ initialCoordinates: coordinates, verticalBounds, visibleEntryIDs, - location: 'fixed', + tooltipLocation: 'fixed', margin, item, chatInputBarHeight: currentInputBarHeight, 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 @@ -93,7 +93,7 @@ +presentedFrom: string, +initialCoordinates: LayoutCoordinates, +verticalBounds: VerticalBounds, - +location?: 'above' | 'below' | 'fixed', + +tooltipLocation?: 'above' | 'below' | 'fixed', +margin?: number, +visibleEntryIDs?: $ReadOnlyArray, +chatInputBarHeight?: number, @@ -273,18 +273,18 @@ } get tooltipHeight(): number { - if (this.props.route.params.location === 'fixed') { + if (this.props.route.params.tooltipLocation === 'fixed') { return fixedTooltipHeight; } else { return tooltipHeight(this.entries.length); } } - get location(): 'above' | 'below' | 'fixed' { + get tooltipLocation(): 'above' | 'below' | 'fixed' { const { params } = this.props.route; - const { location } = params; - if (location) { - return location; + const { tooltipLocation } = params; + if (tooltipLocation) { + return tooltipLocation; } const { initialCoordinates, verticalBounds } = params; @@ -353,14 +353,14 @@ chatInputBarHeight, } = route.params; const { x, y, width, height } = initialCoordinates; - const { margin, location } = this; + const { margin, tooltipLocation } = this; const style = {}; style.position = 'absolute'; (style.alignItems = 'center'), (style.opacity = this.tooltipContainerOpacity); - if (location !== 'fixed') { + if (tooltipLocation !== 'fixed') { style.transform = [{ translateX: this.tooltipHorizontal }]; } @@ -376,7 +376,7 @@ const inputBarHeight = chatInputBarHeight ?? 0; - if (location === 'fixed') { + if (tooltipLocation === 'fixed') { const padding = 8; style.minWidth = dimensions.width - 16; @@ -388,7 +388,7 @@ verticalBounds.y - inputBarHeight + padding; - } else if (location === 'above') { + } else if (tooltipLocation === 'above') { style.bottom = dimensions.height - Math.max(y, verticalBounds.y) + margin; style.transform.push({ translateY: this.tooltipVerticalAbove }); @@ -399,7 +399,7 @@ style.transform.push({ translateY: this.tooltipVerticalBelow }); } - if (location !== 'fixed') { + if (tooltipLocation !== 'fixed') { style.transform.push({ scale: this.tooltipScale }); } @@ -429,14 +429,14 @@ const tooltipContainerStyle = [styles.itemContainer]; - if (this.location === 'fixed') { + if (this.tooltipLocation === 'fixed') { tooltipContainerStyle.push(styles.itemContainerFixed); } const { entries } = this; const items = entries.map((entry, index) => { let style; - if (this.location === 'fixed') { + if (this.tooltipLocation === 'fixed') { style = index !== entries.length - 1 ? styles.itemMarginFixed : null; } else { style = index !== entries.length - 1 ? styles.itemMargin : null; @@ -453,7 +453,7 @@ ); }); - if (this.location === 'fixed' && entries.length > 3) { + if (this.tooltipLocation === 'fixed' && entries.length > 3) { items.splice(3); const moreSpec = { @@ -495,10 +495,10 @@ let triangleDown = null; let triangleUp = null; - const { location } = this; - if (location === 'above') { + const { tooltipLocation } = this; + if (tooltipLocation === 'above') { triangleDown = ; - } else if (location === 'below') { + } else if (tooltipLocation === 'below') { triangleUp = ; } @@ -521,7 +521,7 @@ let tooltip = null; - if (this.location !== 'fixed') { + if (this.tooltipLocation !== 'fixed') { tooltip = ( ); } else if ( - this.location === 'fixed' && + this.tooltipLocation === 'fixed' && !hideTooltip && !showEmojiKeyboard.value ) { @@ -564,7 +564,7 @@ } onPressBackdrop = () => { - if (this.location !== 'fixed') { + if (this.tooltipLocation !== 'fixed') { this.props.navigation.goBackOnce(); } else { this.props.setHideTooltip(true); @@ -572,7 +572,10 @@ }; onPressEntry = (entry: TooltipEntry) => { - if (this.location !== 'fixed' || this.props.actionSheetShown.value) { + if ( + this.tooltipLocation !== 'fixed' || + this.props.actionSheetShown.value + ) { this.props.navigation.goBackOnce(); } else { this.props.setHideTooltip(true);