MCPcopy Create free account
hub / github.com/dailydotdev/apps / UserListModal

Function UserListModal

packages/shared/src/components/modals/UserListModal.tsx:34–91  ·  view source on GitHub ↗
({
  users,
  title,
  header,
  scrollingProps,
  placeholderAmount,
  size = Modal.Size.Medium,
  userListProps,
  onSearch,
  origin,
  showFollow = true,
  showSubscribe = true,
  showAward,
  children,
  ...props
}: UserListModalProps)

Source from the content-addressed store, hash-verified

32}
33
34function UserListModal({
35 users,
36 title,
37 header,
38 scrollingProps,
39 placeholderAmount,
40 size = Modal.Size.Medium,
41 userListProps,
42 onSearch,
43 origin,
44 showFollow = true,
45 showSubscribe = true,
46 showAward,
47 children,
48 ...props
49}: UserListModalProps): ReactElement {
50 const container = useRef<HTMLElement>(
51 null,
52 ) as React.MutableRefObject<HTMLElement>;
53 const [modalRef, setModalRef] = useState<HTMLElement>();
54
55 const { onScroll, ...otherScrollingProps } = scrollingProps;
56
57 return (
58 <Modal
59 contentRef={(e) => setModalRef(e)}
60 kind={Modal.Kind.FlexibleCenter}
61 size={size}
62 {...props}
63 >
64 {header ?? <Modal.Header title={title} />}
65 <Modal.Body className="!p-0" onScroll={onScroll} ref={container}>
66 {onSearch && (
67 <SearchField
68 className="mx-6 my-4"
69 inputId="members-search"
70 valueChanged={onSearch}
71 />
72 )}
73 {children}
74 <UserList
75 {...userListProps}
76 users={users}
77 scrollingProps={otherScrollingProps}
78 placeholderAmount={placeholderAmount}
79 userInfoProps={{
80 scrollingContainer: container.current,
81 appendTooltipTo: modalRef,
82 origin,
83 showFollow,
84 showAward,
85 showSubscribe,
86 }}
87 />
88 </Modal.Body>
89 </Modal>
90 );
91}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected