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

Function usePatchyContext

packages/shared/src/features/patchy/PatchyMenu.tsx:78–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76};
77
78export const usePatchyContext = (): PatchyContext => {
79 const router = useRouter();
80 const client = useQueryClient();
81 const readingPost = getPatchyReadingPost();
82 return getPatchyContext({
83 path: router?.asPath ?? '/',
84 query: router?.query ?? {},
85 post: readingPost && getPatchyCurrentPost(client, readingPost),
86 });
87};
88
89// What you can ask Patchy for, in his corner of the Streak panel. It depends
90// on where you are: a post, your feed, a tag, a source, your bookmarks or a

Callers 1

PatchyPanelHeaderFunction · 0.90

Calls 4

getPatchyReadingPostFunction · 0.90
getPatchyContextFunction · 0.90
getPatchyCurrentPostFunction · 0.90
useRouterFunction · 0.50

Tested by

no test coverage detected