diff --git a/web/settings/relationship/friend-list-row.react.js b/web/settings/relationship/friend-list-row.react.js index 841bf2ebb..9cb457aba 100644 --- a/web/settings/relationship/friend-list-row.react.js +++ b/web/settings/relationship/friend-list-row.react.js @@ -1,48 +1,59 @@ // @flow 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'; import css from './friend-list-row.css'; import type { UserRowProps } from './user-list.react'; 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 = ( - ); } else if ( userInfo.relationshipStatus === userRelationshipStatus.REQUEST_RECEIVED ) { buttons = ( <> - - + ); } else if (userInfo.relationshipStatus === userRelationshipStatus.FRIEND) { buttons = ( ); } return (
{userInfo.username}
{buttons}
); } export default FriendListRow;