From ca34989836d109556e2f8a7ce4cf607194465b87 Mon Sep 17 00:00:00 2001 From: vorujack Date: Wed, 17 Apr 2024 12:32:53 +0330 Subject: [PATCH] display token count in wallets list page --- src/pages/wallets/Wallets.tsx | 1 + src/pages/wallets/components/WalletItem.tsx | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/pages/wallets/Wallets.tsx b/src/pages/wallets/Wallets.tsx index ca58af9..7eb31f8 100644 --- a/src/pages/wallets/Wallets.tsx +++ b/src/pages/wallets/Wallets.tsx @@ -44,6 +44,7 @@ const Wallets = () => { name={item.name} type={item.type} net={item.networkType} + tokensCount={item.tokens.length} amount={BigInt(item.balance)} key={index} /> diff --git a/src/pages/wallets/components/WalletItem.tsx b/src/pages/wallets/components/WalletItem.tsx index 38b9592..10ddf1a 100644 --- a/src/pages/wallets/components/WalletItem.tsx +++ b/src/pages/wallets/components/WalletItem.tsx @@ -17,6 +17,7 @@ interface PropsType { type: WalletType; net?: string; amount?: bigint; + tokensCount?: number; onClick?: () => unknown; } @@ -90,6 +91,11 @@ const WalletItem = (props: PropsType) => { ) : null} + {props.tokensCount && props.tokensCount > 0 ? ( + + Includes {props.tokensCount} token{props.tokensCount > 1 ? 's' : ''} + + ) : null}