Skip to content

Commit

Permalink
Site Editor Sidebar: improvements to buttons (#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 Jun 23, 2023
1 parent 04f0eba commit 7e0d080
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

1 comment on commit 7e0d080

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 7e0d080.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5353981318
📝 Reported issues:

Please sign in to comment.