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

Function FeedItemComponent

packages/shared/src/components/FeedItemComponent.tsx:277–539  ·  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

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