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

Function FeedItemComponent

packages/shared/src/components/FeedItemComponent.tsx:274–523  ·  view source on GitHub ↗
({
  item,
  index,
  row,
  column,
  columns,
  openNewTab,
  postMenuIndex,
  user,
  feedName,
  ranking,
  toggleUpvote,
  toggleDownvote,
  onPostClick,
  onShare,
  onCopyLinkClick,
  toggleBookmark,
  onMenuClick,
  onCommentClick,
  onReadArticleClick,
  virtualizedNumCards,
  wideColSpan,
}: FeedItemComponentProps)

Source from the content-addressed store, hash-verified

272};
273
274function FeedItemComponent({
275 item,
276 index,
277 row,
278 column,
279 columns,
280 openNewTab,
281 postMenuIndex,
282 user,
283 feedName,
284 ranking,
285 toggleUpvote,
286 toggleDownvote,
287 onPostClick,
288 onShare,
289 onCopyLinkClick,
290 toggleBookmark,
291 onMenuClick,
292 onCommentClick,
293 onReadArticleClick,
294 virtualizedNumCards,
295 wideColSpan,
296}: FeedItemComponentProps): ReactElement | null {
297 const { logEvent } = useLogContext();
298 const inViewRef = useLogImpression(
299 item,
300 index,
301 columns,
302 column,
303 row,
304 feedName,
305 ranking,
306 wideColSpan,
307 );
308
309 const { shouldUseListFeedLayout, shouldUseListMode } = useFeedLayout();
310 const { boostedBy } = useFeedCardContext();
311
312 if (item.type === FeedItemType.Highlight) {
313 const HighlightTag =
314 shouldUseListFeedLayout || shouldUseListMode
315 ? HighlightList
316 : HighlightGrid;
317 const highlightIds = getHighlightIds(item.highlights);
318
319 return (
320 <HighlightTag
321 ref={inViewRef}
322 highlights={item.highlights}
323 onReadAllClick={() => {
324 logEvent(
325 feedHighlightsLogEvent(LogEvent.Click, {
326 columns: virtualizedNumCards,
327 column,
328 row,
329 feedName,
330 ranking,
331 action: 'read_all_click',

Callers

nothing calls this directly

Calls 15

useLogContextFunction · 0.90
useFeedLayoutFunction · 0.90
useFeedCardContextFunction · 0.90
getHighlightIdsFunction · 0.90
feedHighlightsLogEventFunction · 0.90
isBoostedPostAdFunction · 0.90
isBoostedSquadAdFunction · 0.90
isSourceSquadOrMachineFunction · 0.90
useLogImpressionFunction · 0.85
logEventFunction · 0.85
getTagsFunction · 0.85
getPostTypeForCardFunction · 0.85

Tested by

no test coverage detected