Page MenuHomePhabricator

D3736.diff
No OneTemporary

D3736.diff

diff --git a/web/settings/relationship/friend-list-row.react.js b/web/settings/relationship/friend-list-row.react.js
--- a/web/settings/relationship/friend-list-row.react.js
+++ b/web/settings/relationship/friend-list-row.react.js
@@ -3,6 +3,7 @@
import classnames from 'classnames';
import * as React from 'react';
+import { useRelationshipCallbacks } from 'lib/hooks/relationship-prompt';
import { userRelationshipStatus } from 'lib/types/relationship-types';
import SWMansionIcon from '../../SWMansionIcon.react';
@@ -11,10 +12,15 @@
function FriendListRow(props: UserRowProps): React.Node {
const { userInfo } = props;
+
+ const { friendUser, unfriendUser } = useRelationshipCallbacks(userInfo.id);
let buttons = null;
if (userInfo.relationshipStatus === userRelationshipStatus.REQUEST_SENT) {
buttons = (
- <button className={classnames([css.button, css.destructive])}>
+ <button
+ className={classnames([css.button, css.destructive])}
+ onClick={unfriendUser}
+ >
Cancel request
</button>
);
@@ -23,8 +29,13 @@
) {
buttons = (
<>
- <button className={css.button}>Accept</button>
- <button className={classnames([css.button, css.destructive])}>
+ <button className={css.button} onClick={friendUser}>
+ Accept
+ </button>
+ <button
+ className={classnames([css.button, css.destructive])}
+ onClick={unfriendUser}
+ >
Reject
</button>
</>

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 3:35 PM (19 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2594332
Default Alt Text
D3736.diff (1 KB)

Event Timeline