@@ -10,12 +10,16 @@ import {
1010 Warning ,
1111} from '@wordpress/block-editor' ;
1212import { useSelect } from '@wordpress/data' ;
13- import { PanelBody } from '@wordpress/components' ;
13+ import {
14+ __experimentalToolsPanel as ToolsPanel ,
15+ __experimentalToolsPanelItem as ToolsPanelItem ,
16+ } from '@wordpress/components' ;
1417
1518/**
1619 * Internal dependencies
1720 */
1821import { CommentsPaginationArrowControls } from './comments-pagination-arrow-controls' ;
22+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks' ;
1923
2024const TEMPLATE = [
2125 [ 'core/comments-pagination-previous' ] ,
@@ -45,6 +49,7 @@ export default function QueryPaginationEdit( {
4549 } , [ ] ) ;
4650
4751 const blockProps = useBlockProps ( ) ;
52+ const dropdownMenuProps = useToolsPanelDropdownMenuProps ( ) ;
4853 const innerBlocksProps = useInnerBlocksProps ( blockProps , {
4954 template : TEMPLATE ,
5055 } ) ;
@@ -73,14 +78,29 @@ export default function QueryPaginationEdit( {
7378 < >
7479 { hasNextPreviousBlocks && (
7580 < InspectorControls >
76- < PanelBody title = { __ ( 'Settings' ) } >
77- < CommentsPaginationArrowControls
78- value = { paginationArrow }
79- onChange = { ( value ) => {
80- setAttributes ( { paginationArrow : value } ) ;
81- } }
82- />
83- </ PanelBody >
81+ < ToolsPanel
82+ label = { __ ( 'Settings' ) }
83+ dropdownMenuProps = { dropdownMenuProps }
84+ resetAll = { ( ) =>
85+ setAttributes ( { paginationArrow : 'none' } )
86+ }
87+ >
88+ < ToolsPanelItem
89+ label = { __ ( 'Arrow' ) }
90+ hasValue = { ( ) => paginationArrow !== 'none' }
91+ onDeselect = { ( ) =>
92+ setAttributes ( { paginationArrow : 'none' } )
93+ }
94+ isShownByDefault
95+ >
96+ < CommentsPaginationArrowControls
97+ value = { paginationArrow }
98+ onChange = { ( value ) => {
99+ setAttributes ( { paginationArrow : value } ) ;
100+ } }
101+ />
102+ </ ToolsPanelItem >
103+ </ ToolsPanel >
84104 </ InspectorControls >
85105 ) }
86106 < div { ...innerBlocksProps } />
0 commit comments