manifold/web/hooks/use-admin.ts
Austin Chen 8987a02975
Reapply Manifold for Teams config changes (#54)
* Reapply Manifold for Teams config changes

* Add Firebase config for TheoremOne

* Fix build

* Check in Firebase indexes

* Whitelist admins and new users by email

* Fix typo 🤦‍♂️
2022-02-26 23:29:33 -08:00

9 lines
249 B
TypeScript

import { isAdmin } from '../../common/access'
import { usePrivateUser, useUser } from './use-user'
export const useAdmin = () => {
const user = useUser()
const privateUser = usePrivateUser(user?.id)
return isAdmin(privateUser?.email || '')
}