Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3346484
D9378.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
D9378.diff
View Options
diff --git a/native/profile/relationship-list-item-tooltip-modal.react.js b/native/profile/relationship-list-item-tooltip-modal.react.js
--- a/native/profile/relationship-list-item-tooltip-modal.react.js
+++ b/native/profile/relationship-list-item-tooltip-modal.react.js
@@ -24,7 +24,7 @@
} from '../tooltip/tooltip.react.js';
import Alert from '../utils/alert.js';
-type Action = 'unfriend' | 'unblock';
+type Action = 'unfriend' | 'block' | 'unblock';
export type RelationshipListItemTooltipModalParams = TooltipParams<{
+relativeUserInfo: RelativeUserInfo,
@@ -63,10 +63,12 @@
};
const action = {
unfriend: 'removal',
+ block: 'block',
unblock: 'unblock',
}[input.action];
const message = {
unfriend: `remove ${userText} from friends?`,
+ block: `block ${userText}`,
unblock: `unblock ${userText}?`,
}[input.action];
Alert.alert(
@@ -90,6 +92,12 @@
...route.params,
action: 'unfriend',
});
+
+ const onBlockUser = useRelationshipAction({
+ ...route.params,
+ action: 'block',
+ });
+
const onUnblockUser = useRelationshipAction({
...route.params,
action: 'unblock',
@@ -103,6 +111,7 @@
onPress={onRemoveUser}
key="unfriend"
/>
+ <TooltipItem id="block" text="Block" onPress={onBlockUser} key="block" />
<TooltipItem
id="unblock"
text="Unblock"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 8:56 AM (18 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2562218
Default Alt Text
D9378.diff (1 KB)
Attached To
Mode
D9378: [native] introduce block action to relationship list item tooltip menu
Attached
Detach File
Event Timeline
Log In to Comment