Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brandonbryant12/6c75b5bb9b06a8131538ec0059e9fcb8 to your computer and use it in GitHub Desktop.
Save brandonbryant12/6c75b5bb9b06a8131538ec0059e9fcb8 to your computer and use it in GitHub Desktop.
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