From 93cecb3b4a5ca08c29b2dd4748c362fb034b94f9 Mon Sep 17 00:00:00 2001 From: isstuev Date: Fri, 15 Sep 2023 17:02:59 -0300 Subject: [PATCH] hide some address tabs if no content --- ui/pages/Address.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ui/pages/Address.tsx b/ui/pages/Address.tsx index 4155dd8a2d..2a864a8aac 100644 --- a/ui/pages/Address.tsx +++ b/ui/pages/Address.tsx @@ -72,7 +72,7 @@ const AddressPageContent = () => { count: addressTabsCountersQuery.data?.transactions_count, component: , }, - config.features.beaconChain.isEnabled ? + config.features.beaconChain.isEnabled && addressTabsCountersQuery.data?.withdrawals_count ? { id: 'withdrawals', title: 'Withdrawals', @@ -105,7 +105,7 @@ const AddressPageContent = () => { count: addressTabsCountersQuery.data?.coin_balances_count, component: , }, - config.chain.verificationType === 'validation' ? + config.chain.verificationType === 'validation' && addressTabsCountersQuery.data?.validations_count ? { id: 'blocks_validated', title: 'Blocks validated', @@ -113,12 +113,14 @@ const AddressPageContent = () => { component: , } : undefined, - { - id: 'logs', - title: 'Logs', - count: addressTabsCountersQuery.data?.logs_count, - component: , - }, + addressTabsCountersQuery.data?.logs_count ? + { + id: 'logs', + title: 'Logs', + count: addressTabsCountersQuery.data?.logs_count, + component: , + } : + undefined, addressQuery.data?.is_contract ? { id: 'contract', title: () => {