Skip to content

Commit

Permalink
Simplify blockprops in contact info edit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve committed Feb 7, 2025
1 parent d7c3a8d commit c941788
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions projects/plugins/jetpack/extensions/blocks/contact-info/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,16 @@ const ALLOWED_BLOCKS = [
const TEMPLATE = [ [ 'jetpack/email' ], [ 'jetpack/phone' ], [ 'jetpack/address' ] ];

const ContactInfoEdit = props => {
const { isSelected } = props;
const blockProps = useBlockProps();
const { className, isSelected } = props;
const blockProps = useBlockProps( {
className: clsx( className, {
'jetpack-contact-info-block': true,
'is-selected': isSelected,
} ),
} );

return (
<div
{ ...blockProps }
className={ clsx( blockProps.className, {
'jetpack-contact-info-block': true,
'is-selected': isSelected,
} ) }
>
<div { ...blockProps }>
<InnerBlocks allowedBlocks={ ALLOWED_BLOCKS } templateLock={ false } template={ TEMPLATE } />
</div>
);
Expand Down

0 comments on commit c941788

Please sign in to comment.