Page MenuHomePhabricator

[web] introduce useStaffCanSee hook for web
ClosedPublic

Authored by ginsu on Sep 13 2023, 1:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 20, 2:00 PM
Unknown Object (File)
Mon, Jun 10, 7:49 PM
Unknown Object (File)
Mon, Jun 10, 7:25 PM
Unknown Object (File)
Apr 8 2024, 9:04 PM
Unknown Object (File)
Apr 8 2024, 9:04 PM
Unknown Object (File)
Apr 8 2024, 9:03 PM
Unknown Object (File)
Apr 8 2024, 7:21 PM
Unknown Object (File)
Apr 4 2024, 1:03 AM
Subscribers

Details

Summary

I want to introduce this hook to web so that we can gate some a new appearance settings for non staff members while the light mode/color families for web project is in progress

Depends on D9193

Test Plan

flow and confirmed that the correct value was being returned by hook (returns true during dev mode or when the user is a member of the staff array)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu requested review of this revision.Sep 13 2023, 2:08 PM

Seems reasonable, does it make sense to preemptively just put this in lib as well though like useIsCurrentUserStaff

This revision is now accepted and ready to land.Sep 14 2023, 7:40 AM

Seems reasonable, does it make sense to preemptively just put this in lib as well though like useIsCurrentUserStaff

I thought about that but native has it's own version of the useStaffCanSee hook that is slightly different. The native version of useStaffCanSee also considers if the user is using a staff release as well that web does not need to consider. I thought it would make more sense/be less confusing for other devs that use this in the future if the different versions of each hook lived in their own respective platform folders, but if others disagree happy to make the necessary changes

In D9194#270776, @ginsu wrote:

Seems reasonable, does it make sense to preemptively just put this in lib as well though like useIsCurrentUserStaff

I thought about that but native has it's own version of the useStaffCanSee hook that is slightly different. The native version of useStaffCanSee also considers if the user is using a staff release as well that web does not need to consider. I thought it would make more sense/be less confusing for other devs that use this in the future if the different versions of each hook lived in their own respective platform folders, but if others disagree happy to make the necessary changes

Ah ok yeah that makes sense to me

This revision was automatically updated to reflect the committed changes.