Skip to content

Commit

Permalink
Replace the deprectaed isSecondary prop to variant
Browse files Browse the repository at this point in the history
- Taken from @types/wordpress__components/button/index.d.ts line 21
  • Loading branch information
dantovbein committed Jun 30, 2023
1 parent e452cee commit 3e2ad8e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions assets/src/ImageBlockExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ const addExtraControls = function() {
});
updateCaptionAlignment(option.value);
}}
isPrimary={captionAlignment === option.value}
isSecondary={captionAlignment !== option.value}>
variant={captionAlignment === option.value ? 'primary' : 'secondary'}>
{ option.label }
</Button>;
})
Expand Down
2 changes: 1 addition & 1 deletion assets/src/blocks/Accordion/AccordionEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const renderEdit = ({tabs}, setAttributes, updateTabAttribute) => {
{__('Add item', 'planet4-blocks-backend')}
</Button>
<Button
isSecondary
variant="secondary"
disabled={tabs.length <= 1}
onClick={removeTab}
>
Expand Down
2 changes: 1 addition & 1 deletion assets/src/blocks/Submenu/SubmenuEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const renderEdit = (attributes, setAttributes) => {
{__('Add level', 'planet4-blocks-backend')}
</Button>
<Button
isSecondary
variant="secondary"
onClick={removeLevel}
disabled={attributes.levels.length <= 1}
>
Expand Down

0 comments on commit 3e2ad8e

Please sign in to comment.