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

Function FeedItemComponent

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

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