From 7e0d080ee13eb1ea016132b54b761eb1c8e544e9 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Fri, 23 Jun 2023 09:33:54 +0200 Subject: [PATCH] Site Editor Sidebar: improvements to buttons (#51762) * Do not show tooltip from all "back" buttons * Avoid double button rendering in the patterns screen * Use as prop instead of classname * Add translation to strings --- .../src/components/add-new-pattern/index.js | 14 ++++++-------- .../components/sidebar-navigation-screen/index.js | 4 +++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/edit-site/src/components/add-new-pattern/index.js b/packages/edit-site/src/components/add-new-pattern/index.js index e4c990dae1e868..ab309da1ab12d8 100644 --- a/packages/edit-site/src/components/add-new-pattern/index.js +++ b/packages/edit-site/src/components/add-new-pattern/index.js @@ -12,8 +12,8 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; */ import CreatePatternModal from '../create-pattern-modal'; import CreateTemplatePartModal from '../create-template-part-modal'; -import { unlock } from '../../lock-unlock'; import SidebarButton from '../sidebar-button'; +import { unlock } from '../../lock-unlock'; const { useHistory } = unlock( routerPrivateApis ); @@ -66,13 +66,11 @@ export default function AddNewPattern() { title: __( 'Create pattern' ), }, ] } - icon={ - - } - label={ __( 'Create pattern.' ) } + toggleProps={ { + as: SidebarButton, + } } + icon={ plus } + label={ __( 'Create pattern' ) } /> { showPatternModal && ( ) } { ! isRoot && backPath && ( @@ -69,6 +70,7 @@ export default function SidebarNavigationScreen( { onClick={ () => goTo( backPath, { isBack: true } ) } icon={ icon } label={ __( 'Back' ) } + showTooltip={ false } /> ) } { isRoot && (