Skip to content

Commit

Permalink
Site Editor: Swap pattern creation options (#52726)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Jul 18, 2023
1 parent b78f4dc commit 1cdc1ee
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions packages/edit-site/src/components/add-new-pattern/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,26 @@ export default function AddNewPattern() {
setShowTemplatePartModal( false );
}

const controls = [
{
icon: symbol,
onClick: () => setShowPatternModal( true ),
title: __( 'Create pattern' ),
},
];

if ( ! isTemplatePartsMode ) {
controls.push( {
icon: symbolFilled,
onClick: () => setShowTemplatePartModal( true ),
title: __( 'Create template part' ),
} );
}

return (
<>
<DropdownMenu
controls={ [
! isTemplatePartsMode && {
icon: symbolFilled,
onClick: () => setShowTemplatePartModal( true ),
title: __( 'Create template part' ),
},
{
icon: symbol,
onClick: () => setShowPatternModal( true ),
title: __( 'Create pattern' ),
},
].filter( Boolean ) }
controls={ controls }
toggleProps={ {
as: SidebarButton,
} }
Expand Down

0 comments on commit 1cdc1ee

Please sign in to comment.