Skip to content

Commit

Permalink
Site Editor Sidebar: improvements to buttons (WordPress#51762)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ciampo authored and sethrubenstein committed Jul 13, 2023
1 parent 47150c7 commit 7e3f852
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 6 additions & 8 deletions packages/edit-site/src/components/add-new-pattern/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down Expand Up @@ -66,13 +66,11 @@ export default function AddNewPattern() {
title: __( 'Create pattern' ),
},
] }
icon={
<SidebarButton
icon={ plus }
label={ __( 'Create pattern' ) }
/>
}
label={ __( 'Create pattern.' ) }
toggleProps={ {
as: SidebarButton,
} }
icon={ plus }
label={ __( 'Create pattern' ) }
/>
{ showPatternModal && (
<CreatePatternModal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ export default function SidebarNavigationScreen( {
<NavigatorToParentButton
as={ SidebarButton }
icon={ isRTL() ? chevronRight : chevronLeft }
aria-label={ __( 'Back' ) }
label={ __( 'Back' ) }
showTooltip={ false }
/>
) }
{ ! isRoot && backPath && (
<SidebarButton
onClick={ () => goTo( backPath, { isBack: true } ) }
icon={ icon }
label={ __( 'Back' ) }
showTooltip={ false }
/>
) }
{ isRoot && (
Expand Down

0 comments on commit 7e3f852

Please sign in to comment.