Diffusion Comm e3b1a307ef6a

[web] Make drawer items react based on the current app


[web] Make drawer items react based on the current app

Linear issue: https://linear.app/comm/issue/ENG-2650/make-the-calendar-change-on-community-drawer-action
Pressing an item in the community drawer on web should result in different behaviour depending on the app the user has currently open. In chat it is supposed to open the corresponding chat. In calendar
it is supposed to update the filters so that only the events of the corresponding chat are displayed. In Apps it is supposed to navigate back to the Chat tab and open the corresponding chat.
For each App we either implement a Handler component, or it'll use the default Handler. We obtain these Handlers via getCommunityDrawerItemHandler function. The Handler component doesn't
render anything, but sets a handler object in the drawer item via setHandler. This handler object is of CommunityDrawerItemHandlerSpec type, so it implements all functions that are needed by
the drawer in each tab (that are specific to the tab). For now, it implements the "onClick" function.

Test Plan: Run web app, check that pressing items in the drawer results in the behaviour I described above, based on the tab the user is in.

Reviewers: tomek

Reviewed By: tomek

Subscribers: ashoat, atul

Differential Revision: https://phab.comm.dev/D6292


InkaSokolowskaAuthored on Feb 14 2023, 12:16 AM
Differential Revision
D6292: [web] Make drawer items react based on the current app
rCOMM6d785dcbf345: [web] Add community drawer item handlers