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

Remove leftovers from previous iterations in block inspector #43806

Merged
merged 4 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
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
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
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;
}
}