Skip to content

Commit

Permalink
Fix pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
kattylucy committed Dec 18, 2024
1 parent beccbfd commit 73e8b65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions centrifuge-app/src/components/LoanList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ export function LoanList({ loans, snapshots, isLoading }: Props) {
]),
].filter(Boolean) as Column[]

const pagination = usePagination({ data: rows, pageSize: 20 })

const csvData = React.useMemo(() => {
if (!rows.length) return undefined

Expand All @@ -266,6 +264,8 @@ export function LoanList({ loans, snapshots, isLoading }: Props) {
}, [rows, pool])

const csvUrl = React.useMemo(() => csvData && getCSVDownloadUrl(csvData as any), [csvData])
const filteredData = isLoading ? [] : showRepaid ? rows : rows.filter((row) => !row.marketValue?.isZero())
const pagination = usePagination({ data: filteredData, pageSize: 20 })

if (isLoading) return <Spinner />

Expand Down Expand Up @@ -309,7 +309,7 @@ export function LoanList({ loans, snapshots, isLoading }: Props) {
<Stack gap={2}>
<Box overflow="auto">
<DataTable
data={showRepaid ? rows : rows.filter((row) => !row?.marketValue?.isZero())}
data={filteredData}
columns={columns}
onRowClicked={(row) => `${basePath}/${poolId}/assets/${row.id}`}
pageSize={20}
Expand Down

0 comments on commit 73e8b65

Please sign in to comment.