From 7a393af4c2a231b8c3e0648b5edce0a37dc10133 Mon Sep 17 00:00:00 2001 From: jbinda Date: Tue, 8 Oct 2019 10:47:08 +0200 Subject: [PATCH] [RNMobile] Inner Block Navigate upward through hierarchy (#17496) * add navigate up button on floating toolbar --- .../src/components/block-list/block.native.js | 15 ++++++++++++++- .../src/components/block-list/block.native.scss | 17 +++++++++++++++++ .../src/components/block-list/nav-up-icon.js | 8 ++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 packages/block-editor/src/components/block-list/nav-up-icon.js diff --git a/packages/block-editor/src/components/block-list/block.native.js b/packages/block-editor/src/components/block-list/block.native.js index eac9c7be152062..456c5fad6ac2ab 100644 --- a/packages/block-editor/src/components/block-list/block.native.js +++ b/packages/block-editor/src/components/block-list/block.native.js @@ -11,6 +11,7 @@ import { * WordPress dependencies */ import { Component } from '@wordpress/element'; +import { ToolbarButton, Toolbar } from '@wordpress/components'; import { withDispatch, withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import { getBlockType } from '@wordpress/blocks'; @@ -24,6 +25,7 @@ import BlockEdit from '../block-edit'; import BlockInvalidWarning from './block-invalid-warning'; import BlockMobileToolbar from './block-mobile-toolbar'; import FloatingToolbar from './block-mobile-floating-toolbar'; +import NavigateUpSVG from './nav-up-icon'; class BlockListBlock extends Component { constructor() { @@ -124,7 +126,18 @@ class BlockListBlock extends Component { return ( <> { showFloatingToolbar && ( ! isFirstBlock || parentId === '' ) && } - { showFloatingToolbar && } + { showFloatingToolbar && + ( + + this.props.onSelect( parentId ) } + icon={ NavigateUpSVG } + /> + + + + ) } ; + +export default NavigateUp;