Page MenuHomePhabricator

[web] Add handlers for drawer community items
ClosedPublic

Authored by inka on Mar 7 2023, 3:46 AM.
Tags
None
Referenced Files
F3346299: D6974.diff
Fri, Nov 22, 8:14 AM
Unknown Object (File)
Wed, Nov 20, 4:55 AM
Unknown Object (File)
Tue, Nov 19, 7:45 AM
Unknown Object (File)
Tue, Nov 19, 7:44 AM
Unknown Object (File)
Tue, Nov 19, 7:44 AM
Unknown Object (File)
Tue, Nov 19, 7:44 AM
Unknown Object (File)
Tue, Nov 19, 7:43 AM
Unknown Object (File)
Tue, Nov 19, 7:34 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
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.