From 64265ad22899433fbf8814280d11c0dc4be4b0bd Mon Sep 17 00:00:00 2001 From: Sukhendu Sekhar Guria Date: Tue, 24 Dec 2024 08:27:19 +0530 Subject: [PATCH] Date Block: Add dropdown menu props to ToolsPanel component (#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 Co-authored-by: talldan Co-authored-by: t-hamano --- packages/block-library/src/post-date/edit.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/block-library/src/post-date/edit.js b/packages/block-library/src/post-date/edit.js index 6ac39c0f14798..36de2f7e5d725 100644 --- a/packages/block-library/src/post-date/edit.js +++ b/packages/block-library/src/post-date/edit.js @@ -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 }, @@ -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. @@ -170,6 +176,7 @@ export default function PostDateEdit( { displayType: 'date', } ); } } + dropdownMenuProps={ dropdownMenuProps } >