UNPKG

@wordpress/interface

Version:

Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.

51 lines (47 loc) 1.17 kB
/** * WordPress dependencies */ import { check } from '@wordpress/icons'; import { MenuItem } from '@wordpress/components'; /** * Internal dependencies */ import ComplementaryAreaToggle from '../complementary-area-toggle'; import ActionItem from '../action-item'; const PluginsMenuItem = ( { // Menu item is marked with unstable prop for backward compatibility. // They are removed so they don't leak to DOM elements. // @see https://github.com/WordPress/gutenberg/issues/14457 __unstableExplicitMenuItem, __unstableTarget, ...restProps } ) => <MenuItem { ...restProps } />; export default function ComplementaryAreaMoreMenuItem( { scope, target, __unstableExplicitMenuItem, ...props } ) { return ( <ComplementaryAreaToggle as={ ( toggleProps ) => { return ( <ActionItem __unstableExplicitMenuItem={ __unstableExplicitMenuItem } __unstableTarget={ `${ scope }/${ target }` } as={ PluginsMenuItem } name={ `${ scope }/plugin-more-menu` } { ...toggleProps } /> ); } } role="menuitemcheckbox" selectedIcon={ check } name={ target } scope={ scope } { ...props } /> ); }