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

Function FeedItemComponent

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

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