({
feedName: feedNameProp,
searchQuery,
isSearchOn,
children,
searchChildren,
shortcuts,
navChildren,
isFinder,
onNavTabClick,
}: MainFeedLayoutProps)
| 234 | ]; |
| 235 | |
| 236 | export default function MainFeedLayout({ |
| 237 | feedName: feedNameProp, |
| 238 | searchQuery, |
| 239 | isSearchOn, |
| 240 | children, |
| 241 | searchChildren, |
| 242 | shortcuts, |
| 243 | navChildren, |
| 244 | isFinder, |
| 245 | onNavTabClick, |
| 246 | }: MainFeedLayoutProps): ReactElement { |
| 247 | useScrollRestoration(); |
| 248 | const { sortingEnabled, loadedSettings } = useContext(SettingsContext); |
| 249 | const { user, tokenRefreshed } = useContext(AuthContext); |
| 250 | const { alerts } = useContext(AlertContext); |
| 251 | const { numCards: feedSpacinessCards } = useContext(FeedContext); |
| 252 | const feedWidthStyle = { |
| 253 | '--num-cards': feedSpacinessCards.eco, |
| 254 | '--feed-gap': '2rem', |
| 255 | } as CSSProperties; |
| 256 | const router = useRouter(); |
| 257 | const [tab, setTab] = useState(ExploreTabs.Popular); |
| 258 | const feedName = getFeedName(feedNameProp, { |
| 259 | hasFiltered: !alerts?.filter, |
| 260 | hasUser: !!user, |
| 261 | }); |
| 262 | const { isCustomDefaultFeed, defaultFeedId } = useCustomDefaultFeed(); |
| 263 | const isLaptop = useViewSize(ViewSize.Laptop); |
| 264 | const { isV2 } = useLayoutVariant(); |
| 265 | const feedVersion = useFeature(feature.feedVersion); |
| 266 | const { time, contentCurationFilter } = useSearchContextProvider(); |
| 267 | const isExtension = checkIsExtension(); |
| 268 | const isHomePage = router.pathname === webappUrl; |
| 269 | const { |
| 270 | isUpvoted, |
| 271 | isPopular, |
| 272 | isAnyExplore, |
| 273 | isExploreHub, |
| 274 | isExploreLatest, |
| 275 | isSortableFeed, |
| 276 | isCustomFeed, |
| 277 | isSearch: isSearchPage, |
| 278 | } = useFeedName({ |
| 279 | feedName, |
| 280 | }); |
| 281 | useTrackQuestClientEvent({ |
| 282 | eventType: ClientQuestEventType.VisitExplorePage, |
| 283 | enabled: feedName === OtherFeedPage.Explore, |
| 284 | }); |
| 285 | useTrackQuestClientEvent({ |
| 286 | eventType: ClientQuestEventType.VisitDiscussionsPage, |
| 287 | enabled: feedName === OtherFeedPage.Discussed, |
| 288 | }); |
| 289 | const { |
| 290 | shouldUseListFeedLayout: shouldUseListFeedLayoutRaw, |
| 291 | shouldUseCommentFeedLayout, |
| 292 | FeedPageLayoutComponent: FeedPageLayoutComponentRaw, |
| 293 | } = useFeedLayout(); |
nothing calls this directly
no test coverage detected