Skip to content

Commit

Permalink
Revert all changes to block editor
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Sep 9, 2024
1 parent 77b2364 commit a41e7c8
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions packages/block-editor/src/components/block-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import clsx from 'clsx';
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { useSelect, useDispatch } from '@wordpress/data';
import { useSelect } from '@wordpress/data';
import { useRef } from '@wordpress/element';
import { useViewportMatch } from '@wordpress/compose';
import {
Expand All @@ -16,9 +16,7 @@ import {
isReusableBlock,
isTemplatePart,
} from '@wordpress/blocks';
import { ToolbarGroup, ToolbarButton } from '@wordpress/components';
import { settings as settingsIcon } from '@wordpress/icons';
import { store as interfaceStore } from '@wordpress/interface';
import { ToolbarGroup } from '@wordpress/components';

/**
* Internal dependencies
Expand Down Expand Up @@ -128,16 +126,6 @@ export function PrivateBlockToolbar( {
};
}, [] );

const { enableComplementaryArea, disableComplementaryArea } =
useDispatch( interfaceStore );

const isSelected = useSelect(
( select ) =>
select( interfaceStore ).getActiveComplementaryArea( 'core' ) ===
'edit-post/block',
[]
);

const toolbarWrapperRef = useRef( null );

// Handles highlighting the current block outline on hover or focus of the
Expand Down Expand Up @@ -247,26 +235,6 @@ export function PrivateBlockToolbar( {
</>
) }
<BlockEditVisuallyButton clientIds={ blockClientIds } />
<ToolbarGroup>
<ToolbarButton
icon={ settingsIcon }
label={ __( 'Toggle block settings' ) }
isPressed={ isSelected }
onClick={ () => {
if ( isSelected ) {
disableComplementaryArea(
'core',
'edit-post/block'
);
} else {
enableComplementaryArea(
'core',
'edit-post/block'
);
}
} }
/>
</ToolbarGroup>
{ isDefaultEditingMode && (
<BlockSettingsMenu clientIds={ blockClientIds } />
) }
Expand Down

0 comments on commit a41e7c8

Please sign in to comment.