Skip to content

Commit

Permalink
Read More: Add dropdownMenuProps to ToolsPanel 
Browse files Browse the repository at this point in the history
  • Loading branch information
SainathPoojary committed Jan 17, 2025
1 parent 056786d commit e82af11
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/block-library/src/read-more/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,26 @@ import {
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
import { __ } from '@wordpress/i18n';

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

export default function ReadMore( {
attributes: { content, linkTarget },
setAttributes,
insertBlocksAfter,
} ) {
const blockProps = useBlockProps();
const dropdownMenuProps = useToolsPanelDropdownMenuProps();

return (
<>
<InspectorControls>
<ToolsPanel
label={ __( 'Settings' ) }
resetAll={ () => setAttributes( { linkTarget: '_self' } ) }
dropdownMenuProps={ dropdownMenuProps }
>
<ToolsPanelItem
label={ __( 'Open in new tab' ) }
Expand Down

0 comments on commit e82af11

Please sign in to comment.