Page MenuHomePhorge

D5814.1765339808.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D5814.1765339808.diff

diff --git a/web/chat/composed-message.react.js b/web/chat/composed-message.react.js
--- a/web/chat/composed-message.react.js
+++ b/web/chat/composed-message.react.js
@@ -121,12 +121,16 @@
}
let inlineSidebar = null;
- if (this.props.containsInlineSidebar && item.threadCreatedFromMessage) {
+ if (
+ (this.props.containsInlineSidebar && item.threadCreatedFromMessage) ||
+ item.reactions
+ ) {
const positioning = isViewer ? 'right' : 'left';
inlineSidebar = (
<div className={css.sidebarMarginBottom}>
<InlineSidebar
threadInfo={item.threadCreatedFromMessage}
+ reactions={item.reactions}
positioning={positioning}
/>
</div>
diff --git a/web/chat/inline-sidebar.react.js b/web/chat/inline-sidebar.react.js
--- a/web/chat/inline-sidebar.react.js
+++ b/web/chat/inline-sidebar.react.js
@@ -4,6 +4,7 @@
import * as React from 'react';
import useInlineSidebarText from 'lib/hooks/inline-sidebar-text.react';
+import type { ReactionMessageInfo } from 'lib/types/message-types';
import type { ThreadInfo } from 'lib/types/thread-types';
import CommIcon from '../CommIcon.react';
@@ -12,7 +13,7 @@
type Props = {
+threadInfo: ?ThreadInfo,
- +reactions?: $ReadOnlyArray<string>,
+ +reactions?: $ReadOnlyArray<ReactionMessageInfo>,
+positioning: 'left' | 'center' | 'right',
};
function InlineSidebar(props: Props): React.Node {
@@ -32,14 +33,13 @@
if (!reactions || reactions.length === 0) {
return null;
}
- const reactionsItems = reactions.map(reaction => {
- return (
- <div key={reaction} className={css.reactions}>
- {reaction}
- </div>
- );
- });
- return <div className={css.reactionsContainer}>{reactionsItems}</div>;
+ let reactionText = reactions[0].reaction;
+ if (reactions.length > 1) {
+ reactionText += ` ${reactions.length}`;
+ }
+ const reactionItems = <div style={css.reactions}>{reactionText}</div>;
+
+ return <div className={css.reactionsContainer}>{reactionItems}</div>;
}, [reactions]);
const onClick = useOnClickThread(threadInfo);

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 10, 4:10 AM (18 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5860703
Default Alt Text
D5814.1765339808.diff (2 KB)

Event Timeline