Skip to content

Commit

Permalink
zero case
Browse files Browse the repository at this point in the history
  • Loading branch information
ClanCo committed Nov 10, 2024
1 parent 0e155a6 commit b0ef6fe
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions client/src/ui/components/Balance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,17 @@ const Balance = ({ address, token_address, symbol = "ETH" }: BalanceProps) => {
}
}, [isError, error]);

const symbolImage = symbolImages[symbol];

if (isError || !data) {
return (
<div className="text-xs font-semibold md:font-normal flex items-center bg-secondary">
0 {symbol}
0
{symbolImage ? (
<img src={symbolImage} alt={symbol} className="ml-2 h-8 w-8" />
) : (
<span className="ml-1">{symbol}</span>
)}
</div>
);
}
Expand All @@ -91,8 +98,6 @@ const Balance = ({ address, token_address, symbol = "ETH" }: BalanceProps) => {
// Split the balance string into characters
const balanceChars = balanceString.split("");

const symbolImage = symbolImages[symbol];

return (
<div className="text-xs font-semibold md:font-normal flex items-center bg-secondary">
{balanceChars.map((char, index) => (
Expand Down

0 comments on commit b0ef6fe

Please sign in to comment.