From b0ef6fe5e079bbbe587e7cfb7a3c79f3cbe093aa Mon Sep 17 00:00:00 2001 From: Cosmos 612 Date: Sun, 10 Nov 2024 21:56:31 +0100 Subject: [PATCH] zero case --- client/src/ui/components/Balance.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/client/src/ui/components/Balance.tsx b/client/src/ui/components/Balance.tsx index 31ead3a..19978b2 100644 --- a/client/src/ui/components/Balance.tsx +++ b/client/src/ui/components/Balance.tsx @@ -62,10 +62,17 @@ const Balance = ({ address, token_address, symbol = "ETH" }: BalanceProps) => { } }, [isError, error]); + const symbolImage = symbolImages[symbol]; + if (isError || !data) { return (
- 0 {symbol} + 0 + {symbolImage ? ( + {symbol} + ) : ( + {symbol} + )}
); } @@ -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 (
{balanceChars.map((char, index) => (