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

Function FeedItemComponent

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

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

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