From eceea27625e5480985c0d27e0994edbc6042be23 Mon Sep 17 00:00:00 2001 From: Daniil Polienko Date: Wed, 18 Dec 2024 16:34:01 +0300 Subject: [PATCH 1/2] fix: strategies ui --- .../details/tabs/VaultDetailsStrategies.tsx | 36 ++++++++++--------- .../components/list/VaultsV3ListHead.tsx | 2 +- .../components/list/VaultsV3ListRow.tsx | 7 ++-- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/apps/vaults-v3/components/details/tabs/VaultDetailsStrategies.tsx b/apps/vaults-v3/components/details/tabs/VaultDetailsStrategies.tsx index 72242aa86..ec2ab14e4 100755 --- a/apps/vaults-v3/components/details/tabs/VaultDetailsStrategies.tsx +++ b/apps/vaults-v3/components/details/tabs/VaultDetailsStrategies.tsx @@ -27,7 +27,7 @@ export function VaultDetailsStrategies({currentVault}: {currentVault: TYDaemonVa for (const strategy of currentVault?.strategies || []) { _vaultList.push(vaults[strategy.address]); } - return _vaultList; + return _vaultList.filter(Boolean); }, [vaults, currentVault]); const strategyList = useMemo((): TYDaemonVaultStrategy[] => { @@ -64,22 +64,26 @@ export function VaultDetailsStrategies({currentVault}: {currentVault: TYDaemonVa ** sortDirection values. **********************************************************************************************/ const sortedVaultsToDisplay = useSortVaults([...searchedVaultsToDisplay], sortBy, sortDirection); + const isVaultListEmpty = sortedVaultsToDisplay.length === 0; return ( <> -
-
-

{'Search'}

- + {isVaultListEmpty ? null : ( +
+
+

{'Search'}

+ +
-
-
+ )} + +
) : null} -
+
{'This vault IS the strategy'}

@@ -140,7 +144,7 @@ export function VaultDetailsStrategies({currentVault}: {currentVault: TYDaemonVa

-
+
{'No vaults found'}

{'Try another search term'}

diff --git a/apps/vaults-v3/components/list/VaultsV3ListHead.tsx b/apps/vaults-v3/components/list/VaultsV3ListHead.tsx index 131537841..c14910636 100644 --- a/apps/vaults-v3/components/list/VaultsV3ListHead.tsx +++ b/apps/vaults-v3/components/list/VaultsV3ListHead.tsx @@ -79,7 +79,7 @@ export function VaultsV3ListHead({items, sortBy, sortDirection, onSort}: TListHe
-
+
{rest.map( (item, index): ReactElement => (