Skip to content

Commit 0ef29a7

Browse files
committed
fix: sort
1 parent c604b95 commit 0ef29a7

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

apps/vaults-v3/components/details/tabs/VaultDetailsStrategies.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export function VaultDetailsStrategies({currentVault}: {currentVault: TYDaemonVa
171171
{label: 'Vault', value: 'name', sortable: true, className: 'ml-24'},
172172
{
173173
label: 'Allocation %',
174-
value: 'tvl',
174+
value: 'allocationPercentage',
175175
sortable: true,
176176
className: 'col-span-4'
177177
},

apps/vaults-v3/components/list/VaultsV3ListStrategy.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function VaultsV3ListStrategy({
7474
allocationPercentage: number;
7575
}): ReactElement {
7676
const [isExpanded, set_isExpanded] = useState(false);
77-
console.log(currentVault);
77+
7878
const expandAnimation = {
7979
initial: {
8080
opacity: 0,

apps/vaults/hooks/useSortVaults.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export type TPossibleSortBy =
1313
| 'APY'
1414
| 'estAPY'
1515
| 'tvl'
16+
| 'allocationPercentage'
1617
| 'name'
1718
| 'deposited'
1819
| 'available'
@@ -100,7 +101,7 @@ export function useSortVaults(
100101
}, [sortDirection, vaultList, sortBy]);
101102

102103
const sortedByTVL = useCallback((): TYDaemonVaults => {
103-
if (sortBy !== 'tvl') {
104+
if (sortBy !== 'tvl' && sortBy !== 'allocationPercentage') {
104105
return vaultList;
105106
}
106107
return vaultList.sort((a, b): number => numberSort({a: a.tvl.tvl, b: b.tvl.tvl, sortDirection}));
@@ -200,7 +201,7 @@ export function useSortVaults(
200201
if (sortBy === 'APY') {
201202
return sortedByAPY();
202203
}
203-
if (sortBy === 'tvl') {
204+
if (sortBy === 'tvl' || sortBy === 'allocationPercentage') {
204205
return sortedByTVL();
205206
}
206207
if (sortBy === 'deposited') {

0 commit comments

Comments
 (0)