Skip to content

Commit

Permalink
Rename components
Browse files Browse the repository at this point in the history
to follow the PluginFeatureThatExtend name pattern.
  • Loading branch information
oandregal committed Jul 16, 2018
1 parent dcf20eb commit 1237f0b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions editor/components/block-settings-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import SharedBlockDeleteButton from './shared-block-delete-button';
import BlockHTMLConvertButton from './block-html-convert-button';
import BlockUnknownConvertButton from './block-unknown-convert-button';
import _BlockSettingsMenuFirstItem from './block-settings-menu-first-item';
import BlockSettingsMenuPluginsGroup from './block-settings-menu-plugins-group';
import PluginBlockSettingsMenuGroup from './plugin-block-settings-menu-group';

export class BlockSettingsMenu extends Component {
constructor() {
Expand Down Expand Up @@ -100,7 +100,7 @@ export class BlockSettingsMenu extends Component {
{ count === 1 && <BlockHTMLConvertButton uid={ firstBlockUID } role="menuitem" /> }
<BlockDuplicateButton uids={ uids } rootUID={ rootUID } role="menuitem" />
{ count === 1 && <SharedBlockConvertButton uid={ firstBlockUID } onToggle={ onClose } itemsRole="menuitem" /> }
<BlockSettingsMenuPluginsGroup.Slot fillProps={ { uids, onClose } } />
<PluginBlockSettingsMenuGroup.Slot fillProps={ { uids, onClose } } />
<div className="editor-block-settings-menu__separator" />
{ count === 1 && <SharedBlockDeleteButton uid={ firstBlockUID } onToggle={ onClose } itemsRole="menuitem" /> }
<BlockRemoveButton uids={ uids } role="menuitem" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { createSlotFill } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import { withSelect } from '@wordpress/data';

const { Fill: BlockSettingsMenuPluginsGroup, Slot } = createSlotFill( 'BlockSettingsMenuPluginsGroup' );
const { Fill: PluginBlockSettingsMenuGroup, Slot } = createSlotFill( 'PluginBlockSettingsMenuGroup' );

const BlockSettingsMenuPluginsGroupSlot = ( { fillProps, selectedBlocks } ) => {
const PluginBlockSettingsMenuGroupSlot = ( { fillProps, selectedBlocks } ) => {
selectedBlocks = map( selectedBlocks, ( block ) => block.name );
return (
<Slot fillProps={ { ...fillProps, selectedBlocks } } >
Expand All @@ -26,8 +26,8 @@ const BlockSettingsMenuPluginsGroupSlot = ( { fillProps, selectedBlocks } ) => {
);
};

BlockSettingsMenuPluginsGroup.Slot = withSelect( ( select, { fillProps: { uids } } ) => ( {
PluginBlockSettingsMenuGroup.Slot = withSelect( ( select, { fillProps: { uids } } ) => ( {
selectedBlocks: select( 'core/editor' ).getBlocksByUID( uids ),
} ) )( BlockSettingsMenuPluginsGroupSlot );
} ) )( PluginBlockSettingsMenuGroupSlot );

export default BlockSettingsMenuPluginsGroup;
export default PluginBlockSettingsMenuGroup;
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { compose } from '@wordpress/element';
/**
* Internal dependencies
*/
import BlockSettingsMenuPluginsGroup from './block-settings-menu-plugins-group';
import PluginBlockSettingsMenuGroup from './plugin-block-settings-menu-group';

const isEverySelectedBlockAllowed = ( selected, allowed ) => difference( selected, allowed ).length === 0;

Expand All @@ -30,8 +30,8 @@ const isEverySelectedBlockAllowed = ( selected, allowed ) => difference( selecte
const shouldRenderItem = ( selectedBlockNames, allowedBlockNames ) => ! Array.isArray( allowedBlockNames ) ||
isEverySelectedBlockAllowed( selectedBlockNames, allowedBlockNames );

const BlockSettingsMenuPluginsItem = ( { allowedBlocks, icon, label, onClick, small, role } ) => (
<BlockSettingsMenuPluginsGroup>
const PluginBlockSettingsMenuItem = ( { allowedBlocks, icon, label, onClick, small, role } ) => (
<PluginBlockSettingsMenuGroup>
{ ( { selectedBlocks, onClose } ) => {
if ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {
return null;
Expand All @@ -46,7 +46,7 @@ const BlockSettingsMenuPluginsItem = ( { allowedBlocks, icon, label, onClick, sm
{ ! small && label }
</IconButton> );
} }
</BlockSettingsMenuPluginsGroup>
</PluginBlockSettingsMenuGroup>
);

export default BlockSettingsMenuPluginsItem;
export default PluginBlockSettingsMenuItem;
4 changes: 2 additions & 2 deletions editor/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ export { default as BlockMover } from './block-mover';
export { default as BlockSelectionClearer } from './block-selection-clearer';
export { default as BlockSettingsMenu } from './block-settings-menu';
export { default as _BlockSettingsMenuFirstItem } from './block-settings-menu/block-settings-menu-first-item';
export { default as BlockSettingsMenuPluginsGroup } from './block-settings-menu/block-settings-menu-plugins-group';
export { default as BlockSettingsMenuPluginsItem } from './block-settings-menu/block-settings-menu-plugins-item';
export { default as PluginBlockSettingsMenuGroup } from './block-settings-menu/plugin-block-settings-menu-group';
export { default as PluginBlockSettingsMenuItem } from './block-settings-menu/plugin-block-settings-menu-item';
export { default as BlockTitle } from './block-title';
export { default as BlockToolbar } from './block-toolbar';
export { default as CopyHandler } from './copy-handler';
Expand Down

0 comments on commit 1237f0b

Please sign in to comment.