Skip to content

Commit

Permalink
Add default as prop to PluginMoreMenuItem component (WordPress#39517
Browse files Browse the repository at this point in the history
)

* add default as prop

* also update edit-site package
  • Loading branch information
AnthonyLedesma authored and jostnes committed Mar 23, 2022
1 parent 82839ad commit 9dccdc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import { ActionItem } from '@wordpress/interface';
import { compose } from '@wordpress/compose';
import { MenuItem } from '@wordpress/components';
import { withPluginContext } from '@wordpress/plugins';

/**
Expand Down Expand Up @@ -64,6 +65,7 @@ import { withPluginContext } from '@wordpress/plugins';
export default compose(
withPluginContext( ( context, ownProps ) => {
return {
as: ownProps.as ?? MenuItem,
icon: ownProps.icon || context.icon,
name: 'core/edit-post/plugin-more-menu',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import { ActionItem } from '@wordpress/interface';
import { compose } from '@wordpress/compose';
import { MenuItem } from '@wordpress/components';
import { withPluginContext } from '@wordpress/plugins';

/**
Expand Down Expand Up @@ -64,6 +65,7 @@ import { withPluginContext } from '@wordpress/plugins';
export default compose(
withPluginContext( ( context, ownProps ) => {
return {
as: ownProps.as ?? MenuItem,
icon: ownProps.icon || context.icon,
name: 'core/edit-site/plugin-more-menu',
};
Expand Down

0 comments on commit 9dccdc2

Please sign in to comment.