Skip to content

Commit

Permalink
handle wp.components.Icon size attribute (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckanitz authored Oct 24, 2023
1 parent 75dec54 commit 2f3f7d4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugin/admin/src/js/components/icon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ const LHIcon = (props) => {
`lh-icon icon-${icon?.slug || slug || 'svg'}`
);

return <WPIcon {...props} icon={parsedSvg} className={className} />;
return (
<WPIcon
{...props}
icon={parsedSvg}
className={className}
size={parseInt(icon?.width || icon?.height) || null}
/>
);
}

return <></>;
Expand Down

0 comments on commit 2f3f7d4

Please sign in to comment.