Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Navigator: Use default block appender #22590

Merged
merged 2 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { __, sprintf } from '@wordpress/i18n';
* Internal dependencies
*/
import BlockNavigationLeaf from './leaf';
import ButtonBlockAppender from '../button-block-appender';
import DescenderLines from './descender-lines';
import Inserter from '../inserter';

export default function BlockNavigationAppender( {
parentBlockClientId,
Expand Down Expand Up @@ -41,18 +41,18 @@ export default function BlockNavigationAppender( {
className="block-editor-block-navigation-appender__cell"
colSpan="3"
>
{ ( props ) => (
{ ( { ref, tabIndex, onFocus } ) => (
<div className="block-editor-block-navigation-appender__container">
<DescenderLines
level={ level }
isLastRow={ position === rowCount }
terminatedLevels={ terminatedLevels }
/>
<ButtonBlockAppender
<Inserter
draganescu marked this conversation as resolved.
Show resolved Hide resolved
rootClientId={ parentBlockClientId }
__experimentalSelectBlockOnInsert={ false }
aria-describedby={ descriptionId }
{ ...props }
toggleProps={ { ref, tabIndex, onFocus } }
/>
<div
className="block-editor-block-navigation-appender__description"
Expand Down
17 changes: 10 additions & 7 deletions packages/block-editor/src/components/block-navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,16 @@ $tree-item-height: 36px;
height: $button-size;
}

.block-editor-button-block-appender {
outline: none;
background: none;
padding: $grid-unit-10;
padding: 6px;
margin-left: 0.8em;
width: calc(100% - 0.8em);
.block-editor-inserter__toggle {
background: $dark-gray-primary;
color: $white;
height: $grid-unit-30;
margin: 6px 6px 6px 0.8em;
min-width: $grid-unit-30;

&:active {
color: $white;
}
}
}

Expand Down