({
feedName: feedNameProp,
searchQuery,
isSearchOn,
children,
searchChildren,
shortcuts,
navChildren,
isFinder,
onNavTabClick,
}: MainFeedLayoutProps)
| 225 | ]; |
| 226 | |
| 227 | export default function MainFeedLayout({ |
| 228 | feedName: feedNameProp, |
| 229 | searchQuery, |
| 230 | isSearchOn, |
| 231 | children, |
| 232 | searchChildren, |
| 233 | shortcuts, |
| 234 | navChildren, |
| 235 | isFinder, |
| 236 | onNavTabClick, |
| 237 | }: MainFeedLayoutProps): ReactElement { |
| 238 | useScrollRestoration(); |
| 239 | const { sortingEnabled, loadedSettings } = useContext(SettingsContext); |
| 240 | const { user, tokenRefreshed } = useContext(AuthContext); |
| 241 | const { alerts } = useContext(AlertContext); |
| 242 | const { numCards: feedSpacinessCards } = useContext(FeedContext); |
| 243 | const router = useRouter(); |
| 244 | const [tab, setTab] = useState(ExploreTabs.Popular); |
| 245 | const { getFeatureValue } = useFeaturesReadyContext(); |
| 246 | const feedName = getFeedName(feedNameProp, { |
| 247 | hasFiltered: !alerts?.filter, |
| 248 | hasUser: !!user, |
| 249 | }); |
| 250 | const { isCustomDefaultFeed, defaultFeedId } = useCustomDefaultFeed(); |
| 251 | const isLaptop = useViewSize(ViewSize.Laptop); |
| 252 | const { isV2 } = useLayoutVariant(); |
| 253 | const feedVersion = useFeature(feature.feedVersion); |
| 254 | const { time, contentCurationFilter } = useSearchContextProvider(); |
| 255 | const isExtension = checkIsExtension(); |
| 256 | const isHomePage = router.pathname === webappUrl; |
| 257 | const { |
| 258 | isUpvoted, |
| 259 | isPopular, |
| 260 | isAnyExplore, |
| 261 | isExploreLatest, |
| 262 | isDiscussed, |
| 263 | isSortableFeed, |
| 264 | isCustomFeed, |
| 265 | isSearch: isSearchPage, |
| 266 | } = useFeedName({ |
| 267 | feedName, |
| 268 | }); |
| 269 | useTrackQuestClientEvent({ |
| 270 | eventType: ClientQuestEventType.VisitExplorePage, |
| 271 | enabled: feedName === OtherFeedPage.Explore, |
| 272 | }); |
| 273 | useTrackQuestClientEvent({ |
| 274 | eventType: ClientQuestEventType.VisitDiscussionsPage, |
| 275 | enabled: feedName === OtherFeedPage.Discussed, |
| 276 | }); |
| 277 | const { |
| 278 | shouldUseListFeedLayout: shouldUseListFeedLayoutRaw, |
| 279 | shouldUseCommentFeedLayout, |
| 280 | FeedPageLayoutComponent: FeedPageLayoutComponentRaw, |
| 281 | } = useFeedLayout(); |
| 282 | |
| 283 | // SSR renders /explore/[tag] with FeedPageLayoutMobile. On client hydration with |
| 284 | // a laptop viewport the layout swaps to FeedPage, which causes a hydration |
nothing calls this directly
no test coverage detected