({
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)
| 231 | }; |
| 232 | |
| 233 | function FeedItemComponent({ |
| 234 | item, |
| 235 | index, |
| 236 | row, |
| 237 | column, |
| 238 | columns, |
| 239 | openNewTab, |
| 240 | postMenuIndex, |
| 241 | user, |
| 242 | feedName, |
| 243 | ranking, |
| 244 | toggleUpvote, |
| 245 | toggleDownvote, |
| 246 | onPostClick, |
| 247 | onShare, |
| 248 | onCopyLinkClick, |
| 249 | toggleBookmark, |
| 250 | onMenuClick, |
| 251 | onCommentClick, |
| 252 | onReadArticleClick, |
| 253 | virtualizedNumCards, |
| 254 | wideColSpan, |
| 255 | searchLogExtra, |
| 256 | isExplaining = false, |
| 257 | }: FeedItemComponentProps): ReactElement | null { |
| 258 | const { logEvent } = useLogContext(); |
| 259 | const inViewRef = useLogImpression({ |
| 260 | item, |
| 261 | index, |
| 262 | columns, |
| 263 | column, |
| 264 | row, |
| 265 | feedName, |
| 266 | ranking, |
| 267 | highlightColSpan: wideColSpan, |
| 268 | searchLogExtra, |
| 269 | isExplaining, |
| 270 | }); |
| 271 | |
| 272 | const { shouldUseListFeedLayout, shouldUseListMode } = useFeedLayout(); |
| 273 | const { boostedBy } = useFeedCardContext(); |
| 274 | |
| 275 | if (item.type === FeedItemType.Highlight) { |
| 276 | const HighlightTag = |
| 277 | shouldUseListFeedLayout || shouldUseListMode |
| 278 | ? HighlightList |
| 279 | : HighlightGrid; |
| 280 | const highlightIds = getHighlightIds(item.highlights); |
| 281 | |
| 282 | return ( |
| 283 | <HighlightTag |
| 284 | ref={inViewRef} |
| 285 | highlights={item.highlights} |
| 286 | onReadAllClick={() => { |
| 287 | logEvent( |
| 288 | feedHighlightsLogEvent(LogEvent.Click, { |
| 289 | columns: virtualizedNumCards, |
| 290 | column, |
nothing calls this directly
no test coverage detected