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