Skip to content

Commit

Permalink
DocumentTools: Use standard ToolbarButton for inserter (#68332)
Browse files Browse the repository at this point in the history
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
3 people authored Dec 27, 2024
1 parent f1fadbb commit 1ba8152
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

1 comment on commit 1ba8152

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 1ba8152.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12516707540
📝 Reported issues:

Please sign in to comment.