Skip to content

Commit

Permalink
Fix support for custom icons in ChainLogo
Browse files Browse the repository at this point in the history
Bump version to 3.13.1
  • Loading branch information
jmrossy committed Jun 8, 2024
1 parent 7150abb commit 62dc6b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hyperlane-xyz/widgets",
"description": "Common react components for Hyperlane projects",
"version": "3.13.0",
"version": "3.13.1",
"author": "J M Rossy",
"peerDependencies": {
"react": "^18",
Expand Down
6 changes: 3 additions & 3 deletions src/icons/ChainLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export function ChainLogo({
const iconSize = Math.floor(size / 1.9);

const [svgLogos, setSvgLogos] = useState({});
const logoUri = svgLogos[chainName];

useEffect(() => {
if (!chainName || svgLogos[chainName] || Icon) return;
registry
Expand All @@ -35,9 +37,7 @@ export function ChainLogo({
.catch((err) => console.error(err));
}, [chainName, registry, svgLogos, Icon]);

const logoUri = svgLogos[chainName];

if (!logoUri) {
if (!logoUri && !Icon) {
return (
<Circle size={size} title={title} bgColorSeed={bgColorSeed}>
{chainName ? (
Expand Down

0 comments on commit 62dc6b3

Please sign in to comment.