Skip to content

Commit

Permalink
refactor: Simplify avatar rendering logic by removing conditional lin…
Browse files Browse the repository at this point in the history
…k wrapper in editor
  • Loading branch information
dhananjaykuber committed Feb 13, 2025
1 parent ad5c6c1 commit af875b6
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions packages/block-library/src/avatar/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,29 +193,13 @@ const UserEdit = ( { attributes, context, setAttributes, isSelected } ) => {
avatar={ avatar }
setAttributes={ setAttributes }
/>
{ attributes.isLink ? (
<a
href="#avatar-pseudo-link"
className="wp-block-avatar__link"
onClick={ ( event ) => event.preventDefault() }
>
<ResizableAvatar
attributes={ attributes }
avatar={ avatar }
blockProps={ blockProps }
isSelected={ isSelected }
setAttributes={ setAttributes }
/>
</a>
) : (
<ResizableAvatar
attributes={ attributes }
avatar={ avatar }
blockProps={ blockProps }
isSelected={ isSelected }
setAttributes={ setAttributes }
/>
) }
<ResizableAvatar
attributes={ attributes }
avatar={ avatar }
blockProps={ blockProps }
isSelected={ isSelected }
setAttributes={ setAttributes }
/>
</>
);
};
Expand Down

0 comments on commit af875b6

Please sign in to comment.