Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32411885
D7065.1765345976.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7065.1765345976.diff
View Options
diff --git a/native/chat/inline-engagement.react.js b/native/chat/inline-engagement.react.js
--- a/native/chat/inline-engagement.react.js
+++ b/native/chat/inline-engagement.react.js
@@ -32,9 +32,10 @@
+reactions?: ReactionInfo,
+disabled?: boolean,
+positioning?: 'left' | 'right',
+ +label?: ?string,
};
function InlineEngagement(props: Props): React.Node {
- const { disabled = false, reactions, threadInfo, positioning } = props;
+ const { disabled = false, reactions, threadInfo, positioning, label } = props;
const repliesText = useInlineEngagementText(threadInfo);
const navigateToThread = useNavigateToThread();
@@ -114,7 +115,24 @@
styles.reactionsContainer,
]);
+ const isLeft = positioning === 'left';
+
+ const editedLabel = React.useMemo(() => {
+ const labelLeftRight = isLeft
+ ? styles.messageLabelLeft
+ : styles.messageLabelRight;
+
+ if (!label) {
+ return null;
+ }
+
+ return <Text style={[styles.messageLabel, labelLeftRight]}>{label}</Text>;
+ }, [isLeft, label, styles]);
+
const container = React.useMemo(() => {
+ if (!(sidebarItem || reactionList)) {
+ return null;
+ }
return (
<View style={styles.container}>
{sidebarItem}
@@ -130,7 +148,9 @@
return (
<View style={[styles.inlineEngagement, inlineEngagementPositionStyle]}>
+ {isLeft && editedLabel}
{container}
+ {!isLeft && editedLabel}
</View>
);
}
@@ -192,6 +212,19 @@
flexDirection: 'row',
alignItems: 'center',
},
+ messageLabel: {
+ color: 'listBackgroundLabel',
+ paddingHorizontal: 3,
+ top: 10,
+ },
+ messageLabelLeft: {
+ marginLeft: 9,
+ marginRight: 4,
+ },
+ messageLabelRight: {
+ marginRight: 10,
+ marginLeft: 4,
+ },
};
type TooltipInlineEngagementProps = {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 10, 5:52 AM (15 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5861540
Default Alt Text
D7065.1765345976.diff (1 KB)
Attached To
Mode
D7065: [native] Added displaying labels to InlineEngagement
Attached
Detach File
Event Timeline
Log In to Comment