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

Function useBookmarkProvider

packages/shared/src/hooks/useBookmarkProvider.ts:10–23  ·  view source on GitHub ↗
({
  bookmarked = false,
}: UseBookmarkProviderProps)

Source from the content-addressed store, hash-verified

8}
9
10export const useBookmarkProvider = ({
11 bookmarked = false,
12}: UseBookmarkProviderProps): UseBookmarkProviderReturn => {
13 const { feedName } = useActiveFeedNameContext();
14 const { justBookmarked, wasBookmarked } = useJustBookmarked({ bookmarked });
15
16 const isMyFeed = feedName === SharedFeedPage.MyFeed;
17 const highlightBookmarkedPost =
18 isMyFeed && wasBookmarked && !justBookmarked && bookmarked;
19
20 return {
21 highlightBookmarkedPost,
22 };
23};

Callers 6

CollectionCardHeaderFunction · 0.90
FeedItemContainerFunction · 0.90
PostCardHeaderFunction · 0.90
SquadPostCardHeaderFunction · 0.90
FeedItemContainerFunction · 0.90
PostCardHeaderFunction · 0.90

Calls 2

useActiveFeedNameContextFunction · 0.90
useJustBookmarkedFunction · 0.90

Tested by

no test coverage detected