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 @@ -27,7 +27,11 @@ import { MessageHeader } from './message-header.react.js'; import { useNavigateToSidebar } from './sidebar-navigation.js'; import SwipeableMessage from './swipeable-message.react.js'; -import { useContentAndHeaderOpacity, useDeliveryIconOpacity } from './utils.js'; +import { + messageItemHeight, + useContentAndHeaderOpacity, + useDeliveryIconOpacity, +} from './utils.js'; import UserAvatar from '../avatars/user-avatar.react.js'; import CommIcon from '../components/comm-icon.react.js'; import { type InputState, InputStateContext } from '../input/input-state.js'; @@ -209,27 +213,20 @@ ); } - const viewStyle = [styles.alignment]; + 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 - 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 }); - } + viewStyle.height = messageItemHeight(item); } return ( - <View {...viewProps}> + <View {...viewProps} style={viewStyle}> <AnimatedView style={{ opacity: contentAndHeaderOpacity }}> <MessageHeader item={item} focused={focused} display="lowContrast" /> </AnimatedView> <AnimatedView style={[containerStyle, editedMessageStyle]}> - <View style={viewStyle}> + <View style={styles.alignment}> <View style={[styles.content, alignStyle]}> {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/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 @@ -12,7 +12,11 @@ import { InlineEngagement } from './inline-engagement.react.js'; import { InnerRobotextMessage } from './inner-robotext-message.react.js'; import { Timestamp } from './timestamp.react.js'; -import { getMessageTooltipKey, useContentAndHeaderOpacity } from './utils.js'; +import { + chatMessageItemHeight, + getMessageTooltipKey, + useContentAndHeaderOpacity, +} from './utils.js'; import { ChatContext } from '../chat/chat-context.js'; import { KeyboardContext } from '../keyboard/keyboard-state.js'; import type { AppNavigationProp } from '../navigation/app-navigator.react'; @@ -200,15 +204,15 @@ 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; + viewStyle.height = chatMessageItemHeight(item); } return ( - <View {...viewProps}> + <View {...viewProps} style={viewStyle}> <AnimatedView style={{ opacity: contentAndHeaderOpacity }}> {timestamp} </AnimatedView> - <View onLayout={onLayout} ref={viewRef} style={viewStyle}> + <View onLayout={onLayout} ref={viewRef}> <AnimatedView style={{ opacity: contentAndHeaderOpacity }}> <InnerRobotextMessage item={item}