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