Skip to content

Commit

Permalink
Date Block: Add dropdown menu props to ToolsPanel component (#68018)
Browse files Browse the repository at this point in the history
* Date Block: Add dropdown menu props to ToolsPanel component

* Fix Default formate spacing issue

* Update DateFormatPicker component style

* Fix CSS indentation

* Remove unnecessary CSS

----

Co-authored-by: Sukhendu2002 <sukhendu2002@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
  • Loading branch information
4 people authored Dec 24, 2024
1 parent 23c6b88 commit 64265ad
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/block-library/src/post-date/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ import { edit } from '@wordpress/icons';
import { DOWN } from '@wordpress/keycodes';
import { useSelect } from '@wordpress/data';

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

export default function PostDateEdit( {
attributes: { textAlign, format, isLink, displayType },
context: { postId, postType: postTypeSlug, queryId },
Expand All @@ -45,6 +50,7 @@ export default function PostDateEdit( {
[ `wp-block-post-date__modified-date` ]: displayType === 'modified',
} ),
} );
const dropdownMenuProps = useToolsPanelDropdownMenuProps();

// Use internal state instead of a ref to make sure that the component
// re-renders when the popover's anchor updates.
Expand Down Expand Up @@ -170,6 +176,7 @@ export default function PostDateEdit( {
displayType: 'date',
} );
} }
dropdownMenuProps={ dropdownMenuProps }
>
<ToolsPanelItem
hasValue={ () =>
Expand Down

1 comment on commit 64265ad

@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 64265ad.
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/12476179442
📝 Reported issues:

Please sign in to comment.