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

Function onShowUpvoted

packages/shared/src/hooks/useUpvoteQuery.ts:29–45  ·  view source on GitHub ↗
(
    id: string,
    upvotes: number,
    type: UpvoteType = 'post',
  )

Source from the content-addressed store, hash-verified

27export const useUpvoteQuery = (): UseUpvoteQuery => {
28 const { modal, openModal } = useLazyModal<LazyModal.UpvotedPopup>();
29 const onShowUpvoted = (
30 id: string,
31 upvotes: number,
32 type: UpvoteType = 'post',
33 ) => {
34 openModal({
35 type: LazyModal.UpvotedPopup,
36 props: {
37 placeholderAmount: upvotes,
38 requestQuery: {
39 queryKey: [KEY_MAP[type], id],
40 query: QUERY_MAP[type],
41 params: { id, first: DEFAULT_UPVOTES_PER_PAGE },
42 },
43 },
44 });
45 };
46
47 return useMemo(
48 () => ({ onShowUpvoted, queryKey: modal?.props?.requestQuery?.queryKey }),

Callers 8

CommentFeedFunction · 0.85
PostEngagementsFunction · 0.85
EngagementRailFunction · 0.85
PostFocusCardFunction · 0.85
DiscussionMetaBarFunction · 0.85
PostDiscussionPanelFunction · 0.85
ActivityRepliesTabFunction · 0.85
CompanionContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected