({
item,
index,
row,
column,
columns,
openNewTab,
postMenuIndex,
user,
feedName,
ranking,
toggleUpvote,
toggleDownvote,
onPostClick,
onShare,
onCopyLinkClick,
toggleBookmark,
onMenuClick,
onCommentClick,
onReadArticleClick,
virtualizedNumCards,
wideColSpan,
}: FeedItemComponentProps)
| 275 | }; |
| 276 | |
| 277 | function FeedItemComponent({ |
| 278 | item, |
| 279 | index, |
| 280 | row, |
| 281 | column, |
| 282 | columns, |
| 283 | openNewTab, |
| 284 | postMenuIndex, |
| 285 | user, |
| 286 | feedName, |
| 287 | ranking, |
| 288 | toggleUpvote, |
| 289 | toggleDownvote, |
| 290 | onPostClick, |
| 291 | onShare, |
| 292 | onCopyLinkClick, |
| 293 | toggleBookmark, |
| 294 | onMenuClick, |
| 295 | onCommentClick, |
| 296 | onReadArticleClick, |
| 297 | virtualizedNumCards, |
| 298 | wideColSpan, |
| 299 | }: FeedItemComponentProps): ReactElement | null { |
| 300 | const { logEvent } = useLogContext(); |
| 301 | const inViewRef = useLogImpression( |
| 302 | item, |
| 303 | index, |
| 304 | columns, |
| 305 | column, |
| 306 | row, |
| 307 | feedName, |
| 308 | ranking, |
| 309 | wideColSpan, |
| 310 | ); |
| 311 | |
| 312 | const { shouldUseListFeedLayout, shouldUseListMode } = useFeedLayout(); |
| 313 | const { boostedBy } = useFeedCardContext(); |
| 314 | |
| 315 | if (item.type === FeedItemType.Highlight) { |
| 316 | const HighlightTag = |
| 317 | shouldUseListFeedLayout || shouldUseListMode |
| 318 | ? HighlightList |
| 319 | : HighlightGrid; |
| 320 | const highlightIds = getHighlightIds(item.highlights); |
| 321 | |
| 322 | return ( |
| 323 | <HighlightTag |
| 324 | ref={inViewRef} |
| 325 | highlights={item.highlights} |
| 326 | onReadAllClick={() => { |
| 327 | logEvent( |
| 328 | feedHighlightsLogEvent(LogEvent.Click, { |
| 329 | columns: virtualizedNumCards, |
| 330 | column, |
| 331 | row, |
| 332 | feedName, |
| 333 | ranking, |
| 334 | action: 'read_all_click', |
nothing calls this directly
no test coverage detected