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)
Mon, Nov 11, 4:04 AM
Unknown Object (File)
Mon, Nov 11, 3:57 AM
Unknown Object (File)
Sun, Nov 10, 1:59 PM
Unknown Object (File)
Sun, Nov 10, 3:00 AM
Unknown Object (File)
Thu, Nov 7, 3:08 AM
Unknown Object (File)
Thu, Nov 7, 1:00 AM
Unknown Object (File)
Thu, Nov 7, 12:53 AM
Unknown Object (File)
Wed, Nov 6, 9:02 PM
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
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #23487)

Maybe use the full name?

web/sidebar/community-drawer-item-handler.react.js
3–12 ↗(On Diff #23487)

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 ↗(On Diff #23487)

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.