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