({
item,
index,
row,
column,
columns,
openNewTab,
postMenuIndex,
user,
feedName,
ranking,
toggleUpvote,
toggleDownvote,
onPostClick,
onShare,
onCopyLinkClick,
toggleBookmark,
onMenuClick,
onCommentClick,
onReadArticleClick,
virtualizedNumCards,
wideColSpan,
searchLogExtra,
}: FeedItemComponentProps)
| 223 | }; |
| 224 | |
| 225 | function 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, |
nothing calls this directly
no test coverage detected