Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3359155
D5961.id20229.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5961.id20229.diff
View Options
diff --git a/native/navigation/tooltip.react.js b/native/navigation/tooltip.react.js
--- a/native/navigation/tooltip.react.js
+++ b/native/navigation/tooltip.react.js
@@ -245,7 +245,26 @@
return entries;
}
const visibleSet = new Set(visibleEntryIDs);
- return entries.filter(entry => visibleSet.has(entry.id));
+ const filteredEntries = entries.filter(entry => visibleSet.has(entry.id));
+
+ // this is a temporary change and will be reverted once we go from
+ // message liking to message reactions
+ return filteredEntries.map(entry => {
+ if (entry.id !== 'react') {
+ return entry;
+ }
+
+ const messageLikes = this.props.route.params.item?.reactions.get('👍');
+ let reactionEntryText = entry.text;
+ if (messageLikes && messageLikes.viewerReacted) {
+ reactionEntryText = 'Unlike';
+ }
+
+ return {
+ ...entry,
+ text: reactionEntryText,
+ };
+ });
}
get tooltipHeight(): number {
@@ -635,7 +654,13 @@
};
getPlatformSpecificButtonIndices = (options: Array<string>) => {
- const destructiveButtonIndex = Platform.OS === 'ios' ? 1 : undefined;
+ let destructiveButtonIndex;
+ if (Platform.OS === 'ios') {
+ const reportIndex = options.findIndex(option => option === 'Report');
+ destructiveButtonIndex =
+ reportIndex !== -1 ? options.length - reportIndex : undefined;
+ }
+
const cancelButtonIndex = Platform.OS === 'ios' ? 0 : -1;
// The "Cancel" action is iOS-specific
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 7:34 AM (19 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2578495
Default Alt Text
D5961.id20229.diff (1 KB)
Attached To
Mode
D5961: [native] modified tooltip UI to show 'Unlike' when user already likes a message
Attached
Detach File
Event Timeline
Log In to Comment