Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32166328
D5813.1765050664.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D5813.1765050664.diff
View Options
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
@@ -138,7 +138,7 @@
);
let inlineSidebar = null;
- if (item.threadCreatedFromMessage) {
+ if (item.threadCreatedFromMessage || item.reactions.size > 0) {
const positioning = isViewer ? 'right' : 'left';
const inlineSidebarPositionStyle =
positioning === 'left'
@@ -146,7 +146,10 @@
: styles.rightInlineSidebar;
inlineSidebar = (
<View style={[styles.inlineSidebar, inlineSidebarPositionStyle]}>
- <InlineSidebar threadInfo={item.threadCreatedFromMessage} />
+ <InlineSidebar
+ threadInfo={item.threadCreatedFromMessage}
+ reactions={item.reactions}
+ />
</View>
);
}
diff --git a/native/chat/inline-sidebar.react.js b/native/chat/inline-sidebar.react.js
--- a/native/chat/inline-sidebar.react.js
+++ b/native/chat/inline-sidebar.react.js
@@ -8,6 +8,8 @@
} from 'react-native-reanimated';
import useInlineSidebarText from 'lib/hooks/inline-sidebar-text.react';
+import type { MessageReactionInfo } from 'lib/selectors/chat-selectors';
+import { stringForReactionList } from 'lib/shared/reaction-utils';
import type { ThreadInfo } from 'lib/types/thread-types';
import CommIcon from '../components/comm-icon.react';
@@ -24,7 +26,7 @@
type Props = {
+threadInfo: ?ThreadInfo,
- +reactions?: $ReadOnlyArray<string>,
+ +reactions?: $ReadOnlyMap<string, MessageReactionInfo>,
+disabled?: boolean,
};
function InlineSidebar(props: Props): React.Node {
@@ -41,16 +43,13 @@
const styles = useStyles(unboundStyles);
const reactionList = React.useMemo(() => {
- if (!reactions || reactions.length === 0) {
+ if (!reactions || reactions.size === 0) {
return null;
}
- const reactionItems = reactions.map(reaction => {
- return (
- <Text key={reaction} style={styles.reaction}>
- {reaction}
- </Text>
- );
- });
+
+ const reactionText = stringForReactionList(reactions);
+ const reactionItems = <Text style={styles.reaction}>{reactionText}</Text>;
+
return <View style={styles.reactionsContainer}>{reactionItems}</View>;
}, [reactions, styles.reaction, styles.reactionsContainer]);
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
@@ -54,10 +54,13 @@
const styles = useStyles(unboundStyles);
let inlineSidebar = null;
- if (item.threadCreatedFromMessage) {
+ if (item.threadCreatedFromMessage || item.reactions.size > 0) {
inlineSidebar = (
<View style={styles.sidebar}>
- <InlineSidebar threadInfo={item.threadCreatedFromMessage} />
+ <InlineSidebar
+ threadInfo={item.threadCreatedFromMessage}
+ reactions={item.reactions}
+ />
</View>
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 7:51 PM (21 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5840504
Default Alt Text
D5813.1765050664.diff (2 KB)
Attached To
Mode
D5813: [native] introduce reactions to inline sidebar
Attached
Detach File
Event Timeline
Log In to Comment