Skip to content

Commit

Permalink
Site Title Block: Add dropdown menu props to ToolsPanel component (Wo…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukhendu2002 authored Dec 20, 2024
1 parent ad073b0 commit 6dfea11
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/block-library/src/site-title/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ import {
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
import { decodeEntities } from '@wordpress/html-entities';

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

export default function SiteTitleEdit( {
attributes,
setAttributes,
Expand All @@ -47,6 +52,7 @@ export default function SiteTitleEdit( {
};
}, [] );
const { editEntityRecord } = useDispatch( coreStore );
const dropdownMenuProps = useToolsPanelDropdownMenuProps();

function setTitle( newTitle ) {
editEntityRecord( 'root', 'site', undefined, {
Expand Down Expand Up @@ -121,6 +127,7 @@ export default function SiteTitleEdit( {
linkTarget: '_self',
} );
} }
dropdownMenuProps={ dropdownMenuProps }
>
<ToolsPanelItem
hasValue={ () => isLink !== false }
Expand Down

0 comments on commit 6dfea11

Please sign in to comment.