Page MenuHomePhabricator

[web] Add handlers for drawer community items
ClosedPublic

Authored by inka on Mar 7 2023, 3:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 25 2024, 6:09 PM
Unknown Object (File)
Feb 22 2024, 3:04 PM
Unknown Object (File)
Feb 21 2024, 1:44 AM
Unknown Object (File)
Feb 21 2024, 1:44 AM
Unknown Object (File)
Feb 21 2024, 1:44 AM
Unknown Object (File)
Feb 21 2024, 1:44 AM
Unknown Object (File)
Feb 21 2024, 1:44 AM
Unknown Object (File)
Feb 21 2024, 1:44 AM
Subscribers

Details

Summary

Adding hanndlers that will be used by the community items in the drawer
They will be used like CommunityDrawerItemHandler were used before in CommunityDrawerItem. They provide drawer community items with an onClick function, that defines how the items is
supposed to behave, an expanded boolean, that tells the community whether it is expanded, and a isActive boolean that tells whether the user has currently that exact chat selected.
issue: https://linear.app/comm/issue/ENG-3176/make-pressing-a-drawer-item-in-chat-tab-filter-available-chats

Test Plan

Tested with later diffs

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

inka requested review of this revision.Mar 7 2023, 4:00 AM
tomek added inline comments.
web/sidebar/community-drawer-item-community-handlers.react.js
48

Maybe use the full name?

web/sidebar/community-drawer-item-handler.react.js
3–12

Do we have to introduce a new type? How about adding expanded to CommunityDrawerItemHandler?

This revision is now accepted and ready to land.Mar 24 2023, 11:22 AM
web/sidebar/community-drawer-item-handler.react.js
3–12

expanded is added to CommunityDrawerItemHandler in D6975, but so is a new field - toggleExpanded. I prefer to have separate types for community items, which don't have this filed. It avoids the ambiguity of not knowing which items are supposed to have it defined and which are not.