Skip to content

Commit

Permalink
fix(product-components): connect-explorer missing displaySymbol crash
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasklim committed Feb 5, 2025
1 parent a47b24d commit e4ed0ca
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/product-components/src/components/CoinLogo/CoinLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ export const CoinLogo = ({
size = DEFAULT_SIZE,
...rest
}: CoinLogoProps) => {
const networkSymbol = getNetworkDisplaySymbol(
symbol as NetworkSymbol,
).toLowerCase() as NetworkSymbol;
let symbolSrc;
let badge;

const symbolSrc =
// eslint-disable-next-line no-nested-ternary
type === 'coin'
? COINS[symbol]
: type === 'network'
? NETWORK_ICONS[symbol as NetworkSymbol]
: COINS[networkSymbol != symbol ? networkSymbol : symbol];
if (type === 'coin') {
symbolSrc = COINS[symbol];
} else if (type === 'network') {
symbolSrc = NETWORK_ICONS[symbol as NetworkSymbol];
} else {
// TODO: should be changed, this is hacky way
const networkSymbol = getNetworkDisplaySymbol(
symbol as NetworkSymbol,
)?.toLowerCase() as NetworkSymbol;

const badge =
type !== 'coin' && type !== 'network' && networkSymbol != symbol
? NETWORK_ICONS[symbol as NetworkSymbol]
: null;
badge = networkSymbol !== symbol ? NETWORK_ICONS[symbol as NetworkSymbol] : null;
symbolSrc = COINS[networkSymbol !== symbol ? networkSymbol : symbol];
}

return (
<SvgWrapper className={className} $size={size} {...rest}>
Expand Down

0 comments on commit e4ed0ca

Please sign in to comment.