mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
fix sorting of verified contracts
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export interface VerifiedContractsSorting {
|
||||
sort: 'balance' | 'txs_count';
|
||||
sort: 'balance' | 'transactions_count';
|
||||
order: 'asc' | 'desc';
|
||||
}
|
||||
|
||||
|
||||
@@ -40,8 +40,14 @@ const VerifiedContractsTable = ({ data, sort, setSorting, isLoading }: Props) =>
|
||||
</Link>
|
||||
</Th>
|
||||
<Th width="130px" isNumeric>
|
||||
<Link display="flex" alignItems="center" justifyContent="flex-end" onClick={ isLoading ? undefined : onSortToggle('txs_count') } columnGap={ 1 }>
|
||||
{ sort?.includes('txs_count') && <IconSvg name="arrows/east" boxSize={ 4 } transform={ sortIconTransform }/> }
|
||||
<Link
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
justifyContent="flex-end"
|
||||
onClick={ isLoading ? undefined : onSortToggle('transactions_count') }
|
||||
columnGap={ 1 }
|
||||
>
|
||||
{ sort?.includes('transactions_count') && <IconSvg name="arrows/east" boxSize={ 4 } transform={ sortIconTransform }/> }
|
||||
Txs
|
||||
</Link>
|
||||
</Th>
|
||||
|
||||
@@ -5,11 +5,11 @@ export const SORT_OPTIONS: Array<SelectOption<VerifiedContractsSortingValue>> =
|
||||
{ label: 'Default', value: undefined },
|
||||
{ label: 'Balance descending', value: 'balance-desc' },
|
||||
{ label: 'Balance ascending', value: 'balance-asc' },
|
||||
{ label: 'Txs count descending', value: 'txs_count-desc' },
|
||||
{ label: 'Txs count ascending', value: 'txs_count-asc' },
|
||||
{ label: 'Txs count descending', value: 'transactions_count-desc' },
|
||||
{ label: 'Txs count ascending', value: 'transactions_count-asc' },
|
||||
];
|
||||
|
||||
export const SORT_SEQUENCE: Record<VerifiedContractsSortingField, Array<VerifiedContractsSortingValue | undefined>> = {
|
||||
balance: [ 'balance-desc', 'balance-asc', undefined ],
|
||||
txs_count: [ 'txs_count-desc', 'txs_count-asc', undefined ],
|
||||
transactions_count: [ 'transactions_count-desc', 'transactions_count-asc', undefined ],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user