Skip to content

Commit

Permalink
Only show inserter in document tools if DFM is off (WordPress#60426)
Browse files Browse the repository at this point in the history
Co-authored-by: draganescu <[email protected]>
Co-authored-by: youknowriad <[email protected]>

* only show inserter in document tools if DFM is off

* remove useless CSS hiding the inserter in DFM whcih is not rendered anymore
  • Loading branch information
draganescu authored and cbravobernal committed Apr 9, 2024
1 parent a878185 commit 80cd52a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
1 change: 0 additions & 1 deletion packages/edit-post/src/components/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@
visibility: hidden;
}

& > .edit-post-header__toolbar .editor-document-tools__inserter-toggle,
& > .edit-post-header__toolbar .editor-document-tools__document-overview-toggle,
& > .edit-post-header__settings > .editor-preview-dropdown,
& > .edit-post-header__settings > .interface-pinned-items {
Expand Down
30 changes: 16 additions & 14 deletions packages/editor/src/components/document-tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,22 @@ function DocumentTools( {
variant="unstyled"
>
<div className="editor-document-tools__left">
<ToolbarItem
ref={ inserterButton }
as={ Button }
className="editor-document-tools__inserter-toggle"
variant="primary"
isPressed={ isInserterOpened }
onMouseDown={ preventDefault }
onClick={ toggleInserter }
disabled={ disableBlockTools }
icon={ plus }
label={ showIconLabels ? shortLabel : longLabel }
showTooltip={ ! showIconLabels }
aria-expanded={ isInserterOpened }
/>
{ ! isDistractionFree && (
<ToolbarItem
ref={ inserterButton }
as={ Button }
className="editor-document-tools__inserter-toggle"
variant="primary"
isPressed={ isInserterOpened }
onMouseDown={ preventDefault }
onClick={ toggleInserter }
disabled={ disableBlockTools }
icon={ plus }
label={ showIconLabels ? shortLabel : longLabel }
showTooltip={ ! showIconLabels }
aria-expanded={ isInserterOpened }
/>
) }
{ ( isWideViewport || ! showIconLabels ) && (
<>
{ isLargeViewport && ! hasFixedToolbar && (
Expand Down

0 comments on commit 80cd52a

Please sign in to comment.