Page MenuHomePhabricator

[web] Introduce `ThreadMember` component
ClosedPublic

Authored by jacek on Mar 9 2022, 4:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 5, 8:58 PM
Unknown Object (File)
Oct 16 2024, 8:30 AM
Unknown Object (File)
Oct 16 2024, 8:30 AM
Unknown Object (File)
Oct 16 2024, 8:30 AM
Unknown Object (File)
Oct 16 2024, 8:30 AM
Unknown Object (File)
Oct 14 2024, 1:54 AM
Unknown Object (File)
Oct 14 2024, 1:54 AM
Unknown Object (File)
Oct 14 2024, 1:54 AM

Details

Summary

Introducing component rendering single thread member on the list in thread modal.
It contains menu with actions (added in the next diffs) and displays user role as a label. When the menu is open, the style is a bit different, so it keeps the menu state and receives onMenuChange prop, as the parent component also needs to know the menu status (to disable scrolling when it's open)

Screenshot_Google Chrome_2022-03-09_144343.png (146×347 px, 15 KB)

Test Plan

Component can be tested after introducing thread members modal.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

benschac added inline comments.
web/modals/threads/members/member.react.js
36 ↗(On Diff #10200)

why wrap this in useMemo? couldnt we just pass the icon name string to the component rather than passing the entire icon component?

This revision now requires changes to proceed.Mar 10 2022, 8:39 AM
web/modals/threads/members/member.react.js
36 ↗(On Diff #10200)

The question is related more to Menu component design.
The idea is, that we can pass different components (in an icon prop), that open menu after click - and they may be differently styled.

Make sure to re-request review if you're responding to a comment without any updates! Otherwise, the diff stays in your queue

Rebase & moved onMenuChange callback into the component

This comment was removed by benschac.
tomek added inline comments.
web/modals/threads/members/member.react.js
21 ↗(On Diff #10439)

Maybe SetState<?string> can be used instead?

34–40 ↗(On Diff #10439)

This can be simplified significantly

46 ↗(On Diff #10439)

Why do we declare this, never change and then render? Is it because it is updated in next diffs?

This revision is now accepted and ready to land.Mar 17 2022, 9:18 AM
web/modals/threads/members/member.react.js
46 ↗(On Diff #10439)

Yes, next diff introduces the items.

follow comments after review