Skip to content

Commit

Permalink
Page List Block: Add dropdown menu props to ToolsPanel component (#68012
Browse files Browse the repository at this point in the history
)

Co-authored-by: im3dabasia <[email protected]>
Co-authored-by: fabiankaegy <[email protected]>
  • Loading branch information
3 people authored Dec 16, 2024
1 parent 081a668 commit d02331c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/block-library/src/page-list/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
convertDescription,
ConvertToLinksModal,
} from './convert-to-links-modal';
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';

// We only show the edit option when page count is <= MAX_PAGE_COUNT
// Performance of Navigation Links is not good past this value.
Expand Down Expand Up @@ -124,6 +125,7 @@ export default function PageListEdit( {
const [ isOpen, setOpen ] = useState( false );
const openModal = useCallback( () => setOpen( true ), [] );
const closeModal = () => setOpen( false );
const dropdownMenuProps = useToolsPanelDropdownMenuProps();

const { records: pages, hasResolved: hasResolvedPages } = useEntityRecords(
'postType',
Expand Down Expand Up @@ -326,6 +328,7 @@ export default function PageListEdit( {
resetAll={ () => {
setAttributes( { parentPageID: 0 } );
} }
dropdownMenuProps={ dropdownMenuProps }
>
{ pagesTree.length > 0 && (
<ToolsPanelItem
Expand Down

0 comments on commit d02331c

Please sign in to comment.