Skip to content

Commit

Permalink
Validators list: switch to client-side pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed May 16, 2024
1 parent 1c4447c commit 3dc969c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/pages/ValidatorsPage/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { TableLayout } from '../../components/TableLayoutButton'
import { useGetConsensusValidators, Validator, ValidatorList } from '../../../oasis-nexus/api'
import { useComprehensiveSearchParamsPagination } from '../../components/Table/useComprehensiveSearchParamsPagination'
import { useClientSidePagination } from '../../components/Table/useClientSidePagination'
import { NUMBER_OF_ITEMS_ON_SEPARATE_PAGE } from '../../config'
import { Network } from '../../../types/network'

export const useLoadedValidators = (network: Network, tableView: TableLayout) => {
const pagination = useComprehensiveSearchParamsPagination<Validator, ValidatorList>({
const pagination = useClientSidePagination<Validator, ValidatorList>({
paramName: 'page',
pageSize: NUMBER_OF_ITEMS_ON_SEPARATE_PAGE,
serverPageSize: 1000,
clientPageSize: NUMBER_OF_ITEMS_ON_SEPARATE_PAGE,
})
const offset = pagination.offsetForQuery
const validatorsQuery = useGetConsensusValidators(network, {
Expand Down

0 comments on commit 3dc969c

Please sign in to comment.