Page MenuHomePhabricator

D9378.diff
No OneTemporary

D9378.diff

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

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)

Event Timeline