Renders the list of users behind a count. VoteButton opens it on a dump's
voters, and LikeButton on a comment's likers.
f
UserListPopover(unnamed 0: UserListPopoverProps): React.ReactPortal | null
Renders the users from fetchUrl in a popover next to anchorRef, with a
button that loads the next page. It is fixed and portaled to <body>, so a
card's overflow can't clip it. It renders nothing until it has measured
the anchor.
I
UserListPopoverProps
Passed to UserListPopover by the button whose count was clicked. The
button owns the open state and unmounts the popover in onClose.
- anchorRef: React.RefObject<HTMLElement | null>
-
fetchUrl: string
It answers
PaginatedData<PublicUser>, a page at a time, and the popover addspageandlimitto its query. -
onClose: () => void
Called on an outside click, on Escape, and on a scroll outside it.
Usage
import * as mod from "src/components/social/UserListPopover.tsx";