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

Function useFeedbackModal

packages/shared/src/hooks/useLazyModal.ts:64–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62};
63
64export function useFeedbackModal(): UseFeedbackModal {
65 const client = useQueryClient();
66 const { data: modal } = useQuery({
67 queryKey: FEEDBACK_MODAL_KEY,
68 queryFn: () =>
69 client.getQueryData<LazyModalType<LazyModal.Feedback>>(
70 FEEDBACK_MODAL_KEY,
71 ),
72 enabled: false,
73 });
74 const closeModal = useCallback(() => {
75 window.scrollTo(0, feedbackScrollPosition);
76 feedbackScrollPosition = 0;
77
78 client.setQueryData(FEEDBACK_MODAL_KEY, null);
79 }, [client]);
80
81 return useMemo(() => ({ closeModal, modal }), [closeModal, modal]);
82}

Callers 3

LazyModalElementFunction · 0.90
useFeedbackShortcutFunction · 0.90
InternalAppFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected