Skip to content

Commit

Permalink
Archive: Add dropdown menu props to ToolsPanel component (#68010)
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 d02331c commit dad6c82
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

1 comment on commit dad6c82

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in dad6c82.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12348754308
📝 Reported issues:

Please sign in to comment.