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, Nov 10, 7:53 AM
Unknown Object (File)
Fri, Nov 8, 9:39 PM
Unknown Object (File)
Fri, Nov 8, 9:39 PM
Unknown Object (File)
Fri, Nov 8, 9:39 PM
Unknown Object (File)
Fri, Nov 8, 8:06 PM
Unknown Object (File)
Fri, Nov 8, 5:09 AM
Unknown Object (File)
Tue, Nov 5, 2:12 AM
Unknown Object (File)
Oct 17 2024, 9:45 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.