Page MenuHomePhabricator

[web] introduce useStaffCanSee hook for web
ClosedPublic

Authored by ginsu on Sep 13 2023, 1:49 PM.
Tags
None
Referenced Files
F3180680: D9194.id31141.diff
Fri, Nov 8, 5:09 AM
Unknown Object (File)
Tue, Nov 5, 2:12 AM
Unknown Object (File)
Thu, Oct 17, 9:45 PM
Unknown Object (File)
Oct 4 2024, 7:59 AM
Unknown Object (File)
Oct 2 2024, 10:55 PM
Unknown Object (File)
Sep 16 2024, 12:48 PM
Unknown Object (File)
Sep 14 2024, 7:59 AM
Unknown Object (File)
Sep 8 2024, 1:40 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
No Lint Coverage
Unit
No Test Coverage

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.