Skip to content

Commit

Permalink
Query Page Numbers: Add dropdown menu props to ToolsPanel component (W…
Browse files Browse the repository at this point in the history
…ordPress#68013)

Co-authored-by: im3dabasia <[email protected]>
Co-authored-by: fabiankaegy < [email protected]>
  • Loading branch information
3 people authored and yogeshbhutkar committed Dec 18, 2024
1 parent 41a5c7e commit 504986c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/block-library/src/query-pagination-numbers/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import {
RangeControl,
} from '@wordpress/components';

/**
* Internal dependencies
*/
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';

const createPaginationItem = ( content, Tag = 'a', extraClass = '' ) => (
<Tag key={ content } className={ `page-numbers ${ extraClass }` }>
{ content }
Expand Down Expand Up @@ -50,13 +55,15 @@ export default function QueryPaginationNumbersEdit( {
const paginationNumbers = previewPaginationNumbers(
parseInt( midSize, 10 )
);
const dropdownMenuProps = useToolsPanelDropdownMenuProps();

return (
<>
<InspectorControls>
<ToolsPanel
label={ __( 'Settings' ) }
resetAll={ () => setAttributes( { midSize: 2 } ) }
dropdownMenuProps={ dropdownMenuProps }
>
<ToolsPanelItem
label={ __( 'Number of links' ) }
Expand Down

0 comments on commit 504986c

Please sign in to comment.