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

Function useLfgModals

packages/shared/src/features/lfg/hooks/useLfgModals.ts:14–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12};
13
14export const useLfgModals = (): UseLfgModals => {
15 const { openModal } = useLazyModal();
16 const { logEvent } = useLogContext();
17
18 const openReachOut = useCallback(
19 (post: LfgPost, origin: Origin) => {
20 logEvent({
21 event_name: LogEvent.StartLfgReachOut,
22 target_type: TargetType.LfgPost,
23 target_id: post.id,
24 extra: JSON.stringify({ origin, kind: post.kind }),
25 });
26 openModal({ type: LazyModal.LfgReachOut, props: { post, origin } });
27 },
28 [logEvent, openModal],
29 );
30
31 const openHelper = useCallback(
32 (origin: Origin, prefill?: Partial<LfgHelper>) => {
33 logEvent({
34 event_name: LogEvent.OpenLfgHelper,
35 extra: JSON.stringify({ origin }),
36 });
37 openModal({ type: LazyModal.LfgHelper, props: { origin, prefill } });
38 },
39 [logEvent, openModal],
40 );
41
42 return { openReachOut, openHelper };
43};

Callers 6

LfgSectionFunction · 0.90
LfgBoardFunction · 0.90
HelperSectionFunction · 0.90
LfgProfileSectionFunction · 0.90
LfgMessagesTabFunction · 0.90
PostBodyFunction · 0.90

Calls 4

useLazyModalFunction · 0.90
useLogContextFunction · 0.90
logEventFunction · 0.85
openModalFunction · 0.85

Tested by

no test coverage detected