Skip to content

Commit

Permalink
DocumentTools: Use standard ToolbarButton for inserter
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka committed Dec 26, 2024
1 parent 5af740f commit dd77795
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
9 changes: 3 additions & 6 deletions packages/editor/src/components/document-tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useViewportMatch } from '@wordpress/compose';
import { useSelect, useDispatch } from '@wordpress/data';
import { __, _x } from '@wordpress/i18n';
import { NavigableToolbar, ToolSelector } from '@wordpress/block-editor';
import { Button, ToolbarItem } from '@wordpress/components';
import { ToolbarButton, ToolbarItem } from '@wordpress/components';
import { listView, plus } from '@wordpress/icons';
import { useCallback } from '@wordpress/element';
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
Expand Down Expand Up @@ -118,9 +118,8 @@ function DocumentTools( { className, disableBlockTools = false } ) {
>
<div className="editor-document-tools__left">
{ ! isDistractionFree && (
<ToolbarItem
<ToolbarButton
ref={ inserterSidebarToggleRef }
as={ Button }
className="editor-document-tools__inserter-toggle"
variant="primary"
isPressed={ isInserterOpened }
Expand Down Expand Up @@ -159,8 +158,7 @@ function DocumentTools( { className, disableBlockTools = false } ) {
size="compact"
/>
{ ! isDistractionFree && (
<ToolbarItem
as={ Button }
<ToolbarButton
className="editor-document-tools__document-overview-toggle"
icon={ listView }
disabled={ disableBlockTools }
Expand All @@ -175,7 +173,6 @@ function DocumentTools( { className, disableBlockTools = false } ) {
}
aria-expanded={ isListViewOpen }
ref={ listViewToggleRef }
size="compact"
/>
) }
</>
Expand Down
6 changes: 0 additions & 6 deletions packages/editor/src/components/document-tools/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,8 @@
}

.editor-document-tools .editor-document-tools__left > .editor-document-tools__inserter-toggle.has-icon {
min-width: $button-size-compact;
width: $button-size-compact;
height: $button-size-compact;
padding: 0;

.show-icon-labels & {
width: auto;
height: $button-size-compact;
padding: 0 $grid-unit-10;
}
}
Expand Down

0 comments on commit dd77795

Please sign in to comment.