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

Function FeedItemComponent

packages/shared/src/components/FeedItemComponent.tsx:225–458  ·  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,
}: FeedItemComponentProps)

Source from the content-addressed store, hash-verified

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

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