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

Function FeedItemComponent

packages/shared/src/components/FeedItemComponent.tsx:233–496  ·  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,
  searchLogExtra,
  isExplaining = false,
}: FeedItemComponentProps)

Source from the content-addressed store, hash-verified

231};
232
233function FeedItemComponent({
234 item,
235 index,
236 row,
237 column,
238 columns,
239 openNewTab,
240 postMenuIndex,
241 user,
242 feedName,
243 ranking,
244 toggleUpvote,
245 toggleDownvote,
246 onPostClick,
247 onShare,
248 onCopyLinkClick,
249 toggleBookmark,
250 onMenuClick,
251 onCommentClick,
252 onReadArticleClick,
253 virtualizedNumCards,
254 wideColSpan,
255 searchLogExtra,
256 isExplaining = false,
257}: FeedItemComponentProps): ReactElement | null {
258 const { logEvent } = useLogContext();
259 const inViewRef = useLogImpression({
260 item,
261 index,
262 columns,
263 column,
264 row,
265 feedName,
266 ranking,
267 highlightColSpan: wideColSpan,
268 searchLogExtra,
269 isExplaining,
270 });
271
272 const { shouldUseListFeedLayout, shouldUseListMode } = useFeedLayout();
273 const { boostedBy } = useFeedCardContext();
274
275 if (item.type === FeedItemType.Highlight) {
276 const HighlightTag =
277 shouldUseListFeedLayout || shouldUseListMode
278 ? HighlightList
279 : HighlightGrid;
280 const highlightIds = getHighlightIds(item.highlights);
281
282 return (
283 <HighlightTag
284 ref={inViewRef}
285 highlights={item.highlights}
286 onReadAllClick={() => {
287 logEvent(
288 feedHighlightsLogEvent(LogEvent.Click, {
289 columns: virtualizedNumCards,
290 column,

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
postLogEventFunction · 0.90
feedLogExtraFunction · 0.90
useLogImpressionFunction · 0.85
logEventFunction · 0.85

Tested by

no test coverage detected