Skip to content

Commit

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

* 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 and Gulamdastgir-Momin committed Jan 23, 2025
1 parent 83ecb52 commit 92d86a6
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

0 comments on commit 92d86a6

Please sign in to comment.