HomePhabricator
Diffusion Comm 519b88a1656d

[native] consolidate staff context provider into one file

Description

[native] consolidate staff context provider into one file

Summary:
As I was building the build info page for web, I noticed that the hasStaffUserLoggedIn only lives in native. To get this field into web we should lift the staff context provider into lib so that it can be used on both platforms.

As a preliminary step to that though, I noted that the staff context provider did not really follow the "pattern" that other context providers used where the context lives on top of the provider, and there is a hook called use____Context that the clients can use to use the provider. I really like this pattern that some of the other providers used and wanted to take a second to "tidy up" the staff context provider.

For example:

https://github.com/CommE2E/comm/blob/master/lib/components/modal-provider.react.js
https://github.com/CommE2E/comm/blob/master/web/tooltips/tooltip-provider.js
https://github.com/CommE2E/comm/blob/master/web/search/message-search-state-provider.react.js
https://github.com/CommE2E/comm/blob/master/lib/tunnelbroker/tunnelbroker-context.js

Depends on D10824

Test Plan: flow + confirmed that there were no regressions with native

Reviewers: atul, inka

Reviewed By: atul

Subscribers: ashoat, tomek

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

Details

Provenance
ginsuAuthored on Jan 25 2024, 7:49 AM
Reviewer
atul
Differential Revision
D10825: [native] consolidate staff context provider into one file
Parents
rCOMM51034220c407: [web] introduce build info to users settings list
Branches
Unknown
Tags
Unknown