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

Function FeedItemComponent

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

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