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)
Sun, Jul 21, 5:23 AM
Unknown Object (File)
Thu, Jul 4, 2:50 AM
Unknown Object (File)
Wed, Jul 3, 5:08 PM
Unknown Object (File)
Tue, Jul 2, 2:39 PM
Unknown Object (File)
Sun, Jun 30, 9:21 PM
Unknown Object (File)
Jun 20 2024, 2:00 PM
Unknown Object (File)
Jun 10 2024, 7:49 PM
Unknown Object (File)
Jun 10 2024, 7:25 PM
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.