@@ -38,7 +38,7 @@ import {
3838} from '../search-manager' ;
3939import LibraryContent from './LibraryContent' ;
4040import { LibrarySidebar } from './library-sidebar' ;
41- import { useComponentPickerContext } from './common/context/ComponentPickerContext' ;
41+ import { useComponentPickerContext , CollectionIndexProvider } from './common/context/ComponentPickerContext' ;
4242import { useLibraryContext } from './common/context/LibraryContext' ;
4343import { SidebarBodyComponentId , useSidebarContext } from './common/context/SidebarContext' ;
4444import { allLibraryPageTabs , ContentType , useLibraryRoutes } from './routes' ;
@@ -284,38 +284,40 @@ const LibraryAuthoringPage = ({
284284 extraFilter = { extraFilter }
285285 overrideTypesFilter = { overrideTypesFilter }
286286 >
287- < SubHeader
288- title = { < SubHeaderTitle title = { libraryData . title } /> }
289- subtitle = { ! componentPickerMode ? intl . formatMessage ( messages . headingSubtitle ) : undefined }
290- breadcrumbs = { breadcumbs }
291- headerActions = { < HeaderActions /> }
292- hideBorder
293- />
294- < Tabs
295- variant = "tabs"
296- activeKey = { activeKey }
297- onSelect = { handleTabChange }
298- className = "my-3"
299- >
300- { visibleTabsToRender }
301- </ Tabs >
302- < ActionRow className = "my-3" >
303- < SearchKeywordsField className = "mr-3" />
304- < FilterByTags />
305- { ! ( insideCollections || insideUnits ) && < FilterByBlockType /> }
306- < LibraryFilterByPublished key = {
307- // It is necessary to re-render `LibraryFilterByPublished` every time `FilterByBlockType`
308- // appears or disappears, this is because when the menu is opened it is rendered
309- // in a previous state, causing an inconsistency in its position.
310- // By changing the key we can re-render the component.
311- ! ( insideCollections || insideUnits ) ? 'filter-published-1' : 'filter-published-2'
312- }
287+ < CollectionIndexProvider >
288+ < SubHeader
289+ title = { < SubHeaderTitle title = { libraryData . title } /> }
290+ subtitle = { ! componentPickerMode ? intl . formatMessage ( messages . headingSubtitle ) : undefined }
291+ breadcrumbs = { breadcumbs }
292+ headerActions = { < HeaderActions /> }
293+ hideBorder
313294 />
314- < ClearFiltersButton />
315- < ActionRow . Spacer />
316- < SearchSortWidget />
317- </ ActionRow >
318- < LibraryContent contentType = { activeKey } />
295+ < Tabs
296+ variant = "tabs"
297+ activeKey = { activeKey }
298+ onSelect = { handleTabChange }
299+ className = "my-3"
300+ >
301+ { visibleTabsToRender }
302+ </ Tabs >
303+ < ActionRow className = "my-3" >
304+ < SearchKeywordsField className = "mr-3" />
305+ < FilterByTags />
306+ { ! ( insideCollections || insideUnits ) && < FilterByBlockType /> }
307+ < LibraryFilterByPublished key = {
308+ // It is necessary to re-render `LibraryFilterByPublished` every time `FilterByBlockType`
309+ // appears or disappears, this is because when the menu is opened it is rendered
310+ // in a previous state, causing an inconsistency in its position.
311+ // By changing the key we can re-render the component.
312+ ! ( insideCollections || insideUnits ) ? 'filter-published-1' : 'filter-published-2'
313+ }
314+ />
315+ < ClearFiltersButton />
316+ < ActionRow . Spacer />
317+ < SearchSortWidget />
318+ </ ActionRow >
319+ < LibraryContent contentType = { activeKey } />
320+ </ CollectionIndexProvider >
319321 </ SearchContextProvider >
320322 </ Container >
321323 { ! componentPickerMode && < StudioFooterSlot containerProps = { { size : undefined } } /> }
0 commit comments