Skip to content

Commit

Permalink
Only show inserter in document tools if DFM is off (#60426)
Browse files Browse the repository at this point in the history
Co-authored-by: draganescu <andraganescu@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>

* 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 committed Apr 3, 2024
1 parent 68bd62a commit 6ba2c4e
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 6ba2c4e

Please sign in to comment.