Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page List Block: Add dropdown menu props to ToolsPanel component #68012

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading