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
F2905851: D3677.diff
Sun, Oct 6, 8:31 AM
Unknown Object (File)
Tue, Sep 24, 4:24 PM
Unknown Object (File)
Sep 1 2024, 12:50 AM
Unknown Object (File)
Aug 26 2024, 7:39 AM
Unknown Object (File)
Aug 26 2024, 4:40 AM
Unknown Object (File)
Aug 26 2024, 4:40 AM
Unknown Object (File)
Aug 26 2024, 4:40 AM
Unknown Object (File)
Aug 10 2024, 5:58 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
Branch
ENG-831-3
Lint
No Lint Coverage
Unit
No Test Coverage

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

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

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

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

Ok, makes sense

Use button and update styles

web/settings/relationship/friend-list-row.react.js
15

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

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