manifold/web/hooks/use-users.ts
Austin Chen 279437ba08
List users on admin page (#28)
* Admin page using gridjs

* Move hook into separate file

* Link to each user's Manifold and Firestore /user entry

* Gate admin access to Austin/James/Stephen

* Don't leak the existence of /admin

* Add a custom 404 page that directs to Discord.

* Fix broken window.location.href on NextJS server
2022-01-15 22:09:15 -05:00

13 lines
270 B
TypeScript

import { useState, useEffect } from 'react'
import { listenForAllUsers, User } from '../lib/firebase/users'
export const useUsers = () => {
const [users, setUsers] = useState<User[]>([])
useEffect(() => {
listenForAllUsers(setUsers)
}, [])
return users
}