Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3397747
D8600.id28954.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8600.id28954.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
@@ -12,6 +12,7 @@
import useInlineEngagementText from 'lib/hooks/inline-engagement-text.react.js';
import type { ReactionInfo } from 'lib/selectors/chat-selectors.js';
import { localIDPrefix } from 'lib/shared/message-utils.js';
+import { useViewerAlreadySelectedMessageReactions } from 'lib/shared/reaction-utils.js';
import type { MessageInfo } from 'lib/types/message-types.js';
import type { ThreadInfo } from 'lib/types/thread-types.js';
@@ -158,6 +159,9 @@
});
}, [navigate, reactions]);
+ const viewerAlreadySelectedMessageReactions =
+ useViewerAlreadySelectedMessageReactions(reactions);
+
const reactionStyle = React.useMemo(() => {
const stylesResult = [styles.reactionsContainer];
@@ -182,9 +186,17 @@
return Object.keys(reactions).map(reaction => {
const numOfReacts = reactions[reaction].users.length;
+
+ const viewerReacted =
+ viewerAlreadySelectedMessageReactions.includes(reaction);
+
+ const style = viewerReacted
+ ? [...reactionStyle, styles.reactionsContainerSelected]
+ : reactionStyle;
+
return (
<GestureTouchableOpacity
- style={reactionStyle}
+ style={style}
onPress={() => onPressReaction(reaction)}
onLongPress={onLongPressReaction}
activeOpacity={0.7}
@@ -200,6 +212,8 @@
reactionStyle,
reactions,
styles.reaction,
+ styles.reactionsContainerSelected,
+ viewerAlreadySelectedMessageReactions,
]);
const inlineEngagementPositionStyle = React.useMemo(() => {
@@ -280,6 +294,12 @@
borderRadius: 8,
marginTop: inlineEngagementStyle.marginTop,
},
+ reactionsContainerSelected: {
+ borderWidth: 1,
+ borderColor: 'inlineEngagementLabel',
+ paddingHorizontal: 7,
+ paddingVertical: 3,
+ },
reactionsContainerMarginLeft: {
marginLeft: 4,
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 2, 7:17 PM (21 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608645
Default Alt Text
D8600.id28954.diff (2 KB)
Attached To
Mode
D8600: [native] show which reactions the viewer has already selected in the inline engagement
Attached
Detach File
Event Timeline
Log In to Comment