Skip to content

Commit

Permalink
Archive: Add dropdown menu props to ToolsPanel component (WordPress#6…
Browse files Browse the repository at this point in the history
…8010)

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 3da2e79 commit 41a5c7e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/block-library/src/archives/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ import { __ } from '@wordpress/i18n';
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
import ServerSideRender from '@wordpress/server-side-render';

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

export default function ArchivesEdit( { attributes, setAttributes } ) {
const { showLabel, showPostCounts, displayAsDropdown, type } = attributes;

const dropdownMenuProps = useToolsPanelDropdownMenuProps();

return (
<>
<InspectorControls>
Expand All @@ -28,6 +35,7 @@ export default function ArchivesEdit( { attributes, setAttributes } ) {
type: 'monthly',
} );
} }
dropdownMenuProps={ dropdownMenuProps }
>
<ToolsPanelItem
label={ __( 'Display as dropdown' ) }
Expand Down

0 comments on commit 41a5c7e

Please sign in to comment.