Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tools Panel dropdown menu props to More block #68039

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/block-library/src/more/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import {
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
import { ENTER } from '@wordpress/keycodes';
import { getDefaultBlockName, createBlock } from '@wordpress/blocks';
/**
* Internal dependencies
*/
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';

const DEFAULT_TEXT = __( 'Read more' );

Expand Down Expand Up @@ -41,6 +45,8 @@ export default function MoreEdit( {
width: `${ ( customText ? customText : DEFAULT_TEXT ).length + 1.2 }em`,
};

const dropdownMenuProps = useToolsPanelDropdownMenuProps();

return (
<>
<InspectorControls>
Expand All @@ -51,6 +57,7 @@ export default function MoreEdit( {
noTeaser: false,
} );
} }
dropdownMenuProps={ dropdownMenuProps }
>
<ToolsPanelItem
label={ __( 'Hide excerpt' ) }
Expand Down
Loading