Skip to content

Commit

Permalink
Stop phospher from bombing on missing icon (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyjth authored Jan 26, 2024
1 parent 9551ba0 commit 5e94dbf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/web-shared/ui-kit/PhospherIcon/PhospherIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ const PhospherIcon = ({ name, weight, size, color }) => {
const normalizedName = pascalCase(name);
const IconToRender = Icon[normalizedName];

if (!IconToRender) {
console.warn(`Icon ${name} not found in Phosphor-React`);
return null;
}

return <IconToRender color={color} weight={weight} size={size} />;
};

Expand Down

0 comments on commit 5e94dbf

Please sign in to comment.