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