From e74207b565817cea5ac6bbe371ce82e0fbce7afd Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Wed, 21 Jun 2023 17:50:23 +0200 Subject: [PATCH 1/3] Do not show tooltip from all "back" buttons --- .../src/components/sidebar-navigation-screen/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/edit-site/src/components/sidebar-navigation-screen/index.js b/packages/edit-site/src/components/sidebar-navigation-screen/index.js index 83e0da4cf9f83..be674b4b8636d 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen/index.js @@ -61,14 +61,17 @@ export default function SidebarNavigationScreen( { ) } { ! isRoot && backPath && ( goTo( backPath, { isBack: true } ) } icon={ icon } label={ __( 'Back' ) } + showTooltip={ false } /> ) } { isRoot && ( From da9b7e1b661a943326c667587428df52bc482b32 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Wed, 21 Jun 2023 17:50:42 +0200 Subject: [PATCH 2/3] Avoid double button rendering in the patterns screen --- .../src/components/add-new-pattern/index.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 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 e4c990dae1e86..4af01bc06f84d 100644 --- a/packages/edit-site/src/components/add-new-pattern/index.js +++ b/packages/edit-site/src/components/add-new-pattern/index.js @@ -13,7 +13,6 @@ 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'; const { useHistory } = unlock( routerPrivateApis ); @@ -66,13 +65,11 @@ export default function AddNewPattern() { title: __( 'Create pattern' ), }, ] } - icon={ - - } - label={ __( 'Create pattern.' ) } + toggleProps={ { + className: 'edit-site-sidebar-button', + } } + icon={ plus } + label={ __( 'Create pattern' ) } /> { showPatternModal && ( Date: Thu, 22 Jun 2023 10:56:14 +0200 Subject: [PATCH 3/3] Use as prop instead of classname --- packages/edit-site/src/components/add-new-pattern/index.js | 3 ++- .../src/components/sidebar-navigation-screen/index.js | 1 - 2 files changed, 2 insertions(+), 2 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 4af01bc06f84d..ab309da1ab12d 100644 --- a/packages/edit-site/src/components/add-new-pattern/index.js +++ b/packages/edit-site/src/components/add-new-pattern/index.js @@ -12,6 +12,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; */ import CreatePatternModal from '../create-pattern-modal'; import CreateTemplatePartModal from '../create-template-part-modal'; +import SidebarButton from '../sidebar-button'; import { unlock } from '../../lock-unlock'; const { useHistory } = unlock( routerPrivateApis ); @@ -66,7 +67,7 @@ export default function AddNewPattern() { }, ] } toggleProps={ { - className: 'edit-site-sidebar-button', + as: SidebarButton, } } icon={ plus } label={ __( 'Create pattern' ) } diff --git a/packages/edit-site/src/components/sidebar-navigation-screen/index.js b/packages/edit-site/src/components/sidebar-navigation-screen/index.js index be674b4b8636d..74aeb621f60dd 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen/index.js @@ -67,7 +67,6 @@ export default function SidebarNavigationScreen( { ) } { ! isRoot && backPath && ( goTo( backPath, { isBack: true } ) } icon={ icon } label={ __( 'Back' ) }