Page MenuHomePhabricator

[web] Display friend list buttons in the modal
ClosedPublic

Authored by tomek on Apr 8 2022, 7:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 8:57 AM
Unknown Object (File)
Thu, Nov 14, 8:57 AM
Unknown Object (File)
Thu, Nov 14, 8:57 AM
Unknown Object (File)
Thu, Nov 14, 8:57 AM
Unknown Object (File)
Fri, Nov 8, 7:33 AM
Unknown Object (File)
Fri, Nov 8, 5:09 AM
Unknown Object (File)
Tue, Nov 5, 4:04 AM
Unknown Object (File)
Oct 9 2024, 8:10 PM

Details

Summary

Display the buttons depending on relationship status.

friend-list.png (1×1 px, 84 KB)

Depends on D3676

Test Plan

Render a couple of rows for users with different relationship statuses (friend, request sent, request received) and check if correct buttons are rendered.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.Apr 8 2022, 7:34 AM
benschac added inline comments.
web/settings/relationship/friend-list-row.react.js
15 ↗(On Diff #11244)

I feel like this logic should more closely follow: https://github.com/CommE2E/comm/blob/master/web/chat/relationship-prompt/relationship-prompt.js

maybe we could move it to lib and use the logic in both places?

17 ↗(On Diff #11244)

nit: can we use <button>

This revision now requires changes to proceed.Apr 8 2022, 8:23 AM
web/settings/relationship/friend-list-row.react.js
15 ↗(On Diff #11244)

Thanks for suggestion, but at this point I don't see any logic that can be shared. We have different labels in each of these places and in this diff we're not calling the api - so it also can't be shared. But I do agree, that once friend-list calls the api, there might be some place for reusability. Will give it a try while introducing it.

17 ↗(On Diff #11244)

Ok, makes sense

Use button and update styles

web/settings/relationship/friend-list-row.react.js
15 ↗(On Diff #11244)

After analyzing the differences it doesn't seem like we can share any logic here. E.g. when users are friends, we don't want to display any action in the prompt, but in the setting we show edit icon.

web/settings/relationship/friend-list-row.react.js
15 ↗(On Diff #11244)

Relationship callbacks reusability was achieved in a stack ending with D3736

This revision is now accepted and ready to land.Apr 14 2022, 2:46 PM