Skip to content

Commit

Permalink
Remove leftovers from previous iterations in block inspector (#43806)
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal authored Sep 6, 2022
1 parent ea86d7b commit ecf6417
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/block-editor/src/components/block-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import deprecated from '@wordpress/deprecated';
*/
import BlockIcon from '../block-icon';

function BlockCard( { title, icon, description, blockType, backButton } ) {
function BlockCard( { title, icon, description, blockType } ) {
if ( blockType ) {
deprecated( '`blockType` property in `BlockCard component`', {
since: '5.7',
Expand All @@ -18,7 +18,7 @@ function BlockCard( { title, icon, description, blockType, backButton } ) {
}
return (
<div className="block-editor-block-card">
{ backButton ? backButton : <BlockIcon icon={ icon } showColors /> }
<BlockIcon icon={ icon } showColors />
<div className="block-editor-block-card__content">
<h2 className="block-editor-block-card__title">{ title }</h2>
<span className="block-editor-block-card__description">
Expand Down
8 changes: 2 additions & 6 deletions packages/block-editor/src/components/block-inspector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,18 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
__unstableGetContentLockingParent,
getTemplateLock,
} = select( blockEditorStore );
const { getBlockStyles } = select( blocksStore );

const _selectedBlockClientId = getSelectedBlockClientId();
const _selectedBlockName =
_selectedBlockClientId && getBlockName( _selectedBlockClientId );
const _blockType =
_selectedBlockName && getBlockType( _selectedBlockName );
const blockStyles =
_selectedBlockName && getBlockStyles( _selectedBlockName );

return {
count: getSelectedBlockCount(),
selectedBlockClientId: _selectedBlockClientId,
selectedBlockName: _selectedBlockName,
blockType: _blockType,
hasBlockStyles: blockStyles && blockStyles.length > 0,
topLevelLockedBlock:
getTemplateLock( _selectedBlockClientId ) === 'noContent'
? _selectedBlockClientId
Expand Down Expand Up @@ -232,7 +228,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
);
};

const BlockInspectorSingleBlock = ( { clientId, blockName, backButton } ) => {
const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
const hasBlockStyles = useSelect(
( select ) => {
const { getBlockStyles } = select( blocksStore );
Expand All @@ -244,7 +240,7 @@ const BlockInspectorSingleBlock = ( { clientId, blockName, backButton } ) => {
const blockInformation = useBlockDisplayInformation( clientId );
return (
<div className="block-editor-block-inspector">
<BlockCard backButton={ backButton } { ...blockInformation } />
<BlockCard { ...blockInformation } />
<BlockVariationTransforms blockClientId={ clientId } />
{ hasBlockStyles && (
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,3 @@
border-top: $border-width solid $gray-200;
padding: $grid-unit-20;
}

.block-editor-block-inspector__block-type-type {
font-weight: 500;
&.block-editor-block-inspector__block-type-type {
line-height: $button-size-small;
margin: 0 0 $grid-unit-05;
}
}

0 comments on commit ecf6417

Please sign in to comment.