Created
June 4, 2025 18:35
-
-
Save brandonbryant12/6c75b5bb9b06a8131538ec0059e9fcb8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const CatalogPageWrapper = () => { | |
| const featureFlagsApi = useApi(featureFlagsApiRef); | |
| const isNewCatalogEnabled = featureFlagsApi.isActive('new-catalog-search'); | |
| return ( | |
| <Box sx={{ | |
| display: 'flex', | |
| flexDirection: 'column', | |
| height: '100%', | |
| width: '100%', | |
| overflow: 'hidden' // Prevent double scrollbar | |
| }}> | |
| {/* Feature flag banner - only shows on catalog page */} | |
| <FeatureFlagBanner | |
| flagName="new-catalog-search" | |
| displayName="New Catalog Search" | |
| description="Enable the new catalog search experience" | |
| onToggle={(enabled) => { | |
| // Refresh to load the new/old catalog | |
| setTimeout(() => { | |
| window.location.reload(); | |
| }, 100); | |
| }} | |
| /> | |
| {/* Render the appropriate catalog based on feature flag */} | |
| <Box sx={{ flex: 1, overflow: 'auto' }}> | |
| {isNewCatalogEnabled ? <NewCatalogIndexPage /> : <CatalogIndexPage />} | |
| </Box> | |
| </Box> | |
| ); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment