diff --git a/native/chat/composed-message.react.js b/native/chat/composed-message.react.js --- a/native/chat/composed-message.react.js +++ b/native/chat/composed-message.react.js @@ -209,27 +209,13 @@ ); } - const viewStyle = [styles.alignment]; - if (!__DEV__) { - // We don't force view height in dev mode because we - // want to measure it in Message to see if it's correct - if (item.messageShapeType === 'text') { - viewStyle.push({ height: item.contentHeight }); - } else if (item.messageShapeType === 'multimedia') { - const height = item.inlineEngagementHeight - ? item.contentHeight + item.inlineEngagementHeight - : item.contentHeight; - viewStyle.push({ height }); - } - } - return ( - + {deliveryIcon} {messageBox} diff --git a/native/chat/failed-send.react.js b/native/chat/failed-send.react.js --- a/native/chat/failed-send.react.js +++ b/native/chat/failed-send.react.js @@ -139,7 +139,6 @@ paddingHorizontal: 3, }, failedSendInfo: { - flex: 1, flexDirection: 'row', justifyContent: 'flex-end', marginRight: 20, diff --git a/native/chat/message.react.js b/native/chat/message.react.js --- a/native/chat/message.react.js +++ b/native/chat/message.react.js @@ -64,6 +64,13 @@ } render() { + const viewStyle = {}; + if (!__DEV__) { + // We don't force view height in dev mode because we + // want to measure it in the onLayout below to see if it's correct + viewStyle.height = messageItemHeight(this.props.item); + } + let message; if (this.props.item.messageShapeType === 'text') { message = ( @@ -75,6 +82,7 @@ toggleFocus={this.props.toggleFocus} verticalBounds={this.props.verticalBounds} shouldDisplayPinIndicator={this.props.shouldDisplayPinIndicator} + style={viewStyle} /> ); } else if (this.props.item.messageShapeType === 'multimedia') { @@ -85,6 +93,7 @@ toggleFocus={this.props.toggleFocus} verticalBounds={this.props.verticalBounds} shouldDisplayPinIndicator={this.props.shouldDisplayPinIndicator} + style={viewStyle} /> ); } else { @@ -96,6 +105,7 @@ focused={this.props.focused} toggleFocus={this.props.toggleFocus} verticalBounds={this.props.verticalBounds} + style={viewStyle} /> ); } 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 @@ -196,19 +196,12 @@ const contentAndHeaderOpacity = useContentAndHeaderOpacity(item); - const viewStyle = {}; - if (!__DEV__) { - // We don't force view height in dev mode because we - // want to measure it in Message to see if it's correct - viewStyle.height = item.contentHeight; - } - return ( {timestamp} - +