Changeset View
Changeset View
Standalone View
Standalone View
native/chat/composed-message.react.js
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | const { | ||||
colors, | colors, | ||||
inputState, | inputState, | ||||
navigateToSidebar, | navigateToSidebar, | ||||
contentAndHeaderOpacity, | contentAndHeaderOpacity, | ||||
deliveryIconOpacity, | deliveryIconOpacity, | ||||
...viewProps | ...viewProps | ||||
} = this.props; | } = this.props; | ||||
const { id, creator } = item.messageInfo; | const { id, creator } = item.messageInfo; | ||||
const { hasBeenEdited } = item; | |||||
const { isViewer } = creator; | const { isViewer } = creator; | ||||
const alignStyle = isViewer | const alignStyle = isViewer | ||||
? styles.rightChatBubble | ? styles.rightChatBubble | ||||
: styles.leftChatBubble; | : styles.leftChatBubble; | ||||
let containerMarginBottom = 5; | let containerMarginBottom = 5; | ||||
if (item.endsCluster) { | if (item.endsCluster) { | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | const messageBox = ( | ||||
</AnimatedView> | </AnimatedView> | ||||
</SwipeableMessage> | </SwipeableMessage> | ||||
</View> | </View> | ||||
); | ); | ||||
let inlineEngagement = null; | let inlineEngagement = null; | ||||
if ( | if ( | ||||
item.threadCreatedFromMessage || | item.threadCreatedFromMessage || | ||||
Object.keys(item.reactions).length > 0 | Object.keys(item.reactions).length > 0 || | ||||
hasBeenEdited | |||||
) { | ) { | ||||
const positioning = isViewer ? 'right' : 'left'; | const positioning = isViewer ? 'right' : 'left'; | ||||
const label = hasBeenEdited ? 'Edited' : null; | |||||
inlineEngagement = ( | inlineEngagement = ( | ||||
<InlineEngagement | <InlineEngagement | ||||
threadInfo={item.threadCreatedFromMessage} | threadInfo={item.threadCreatedFromMessage} | ||||
reactions={item.reactions} | reactions={item.reactions} | ||||
positioning={positioning} | positioning={positioning} | ||||
label={label} | |||||
/> | /> | ||||
); | ); | ||||
} | } | ||||
return ( | return ( | ||||
<View {...viewProps}> | <View {...viewProps}> | ||||
<AnimatedView style={{ opacity: contentAndHeaderOpacity }}> | <AnimatedView style={{ opacity: contentAndHeaderOpacity }}> | ||||
<MessageHeader item={item} focused={focused} display="lowContrast" /> | <MessageHeader item={item} focused={focused} display="lowContrast" /> | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |