Changeset View
Changeset View
Standalone View
Standalone View
web/chat/composed-message.react.js
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
class ComposedMessage extends React.PureComponent<Props> { | class ComposedMessage extends React.PureComponent<Props> { | ||||
static defaultProps: { +borderRadius: number } = { | static defaultProps: { +borderRadius: number } = { | ||||
borderRadius: 8, | borderRadius: 8, | ||||
}; | }; | ||||
render(): React.Node { | render(): React.Node { | ||||
assertComposableMessageType(this.props.item.messageInfo.type); | assertComposableMessageType(this.props.item.messageInfo.type); | ||||
const { borderRadius, item, threadInfo } = this.props; | const { borderRadius, item, threadInfo } = this.props; | ||||
const { hasBeenEdited } = item; | |||||
const { id, creator } = item.messageInfo; | const { id, creator } = item.messageInfo; | ||||
const threadColor = threadInfo.color; | const threadColor = threadInfo.color; | ||||
const { isViewer } = creator; | const { isViewer } = creator; | ||||
const contentClassName = classNames({ | const contentClassName = classNames({ | ||||
[css.content]: true, | [css.content]: true, | ||||
[css.viewerContent]: isViewer, | [css.viewerContent]: isViewer, | ||||
[css.nonViewerContent]: !isViewer, | [css.nonViewerContent]: !isViewer, | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | if (isViewer) { | ||||
{deliveryIconSpan} | {deliveryIconSpan} | ||||
</div> | </div> | ||||
); | ); | ||||
} | } | ||||
let inlineEngagement = null; | let inlineEngagement = null; | ||||
if ( | if ( | ||||
(this.props.containsInlineEngagement && item.threadCreatedFromMessage) || | (this.props.containsInlineEngagement && 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 = ( | ||||
<div className={css.sidebarMarginBottom}> | <div className={css.sidebarMarginBottom}> | ||||
<InlineEngagement | <InlineEngagement | ||||
threadInfo={item.threadCreatedFromMessage} | threadInfo={item.threadCreatedFromMessage} | ||||
reactions={item.reactions} | reactions={item.reactions} | ||||
positioning={positioning} | positioning={positioning} | ||||
label={label} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
} | } | ||||
return ( | return ( | ||||
<React.Fragment> | <React.Fragment> | ||||
{authorName} | {authorName} | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |