From 3cd445f60f73cb2d918bbdacc376fc5ff1054c3e Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Thu, 17 Nov 2022 13:04:56 +0000 Subject: [PATCH 1/3] Add very simple back button to block inspector --- .../src/components/block-card/index.js | 27 +++++++++++++++++-- .../src/components/block-inspector/index.js | 23 ++++++++++++++-- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/packages/block-editor/src/components/block-card/index.js b/packages/block-editor/src/components/block-card/index.js index 21832629b9557f..7c4fbb269a1a32 100644 --- a/packages/block-editor/src/components/block-card/index.js +++ b/packages/block-editor/src/components/block-card/index.js @@ -2,13 +2,22 @@ * WordPress dependencies */ import deprecated from '@wordpress/deprecated'; - +import { Button } from '@wordpress/components'; +import { chevronLeft, chevronRight } from '@wordpress/icons'; +import { __, isRTL } from '@wordpress/i18n'; /** * Internal dependencies */ import BlockIcon from '../block-icon'; -function BlockCard( { title, icon, description, blockType } ) { +function BlockCard( { + title, + icon, + description, + blockType, + parentBlockClientId, + handleBackButton, +} ) { if ( blockType ) { deprecated( '`blockType` property in `BlockCard component`', { since: '5.7', @@ -16,8 +25,22 @@ function BlockCard( { title, icon, description, blockType } ) { } ); ( { title, icon, description } = blockType ); } + return (
+ { parentBlockClientId && ( +