|
|
@@ -12,7 +12,7 @@ import {
|
|
|
Typography,
|
|
|
Tag,
|
|
|
} from 'antd'
|
|
|
-import type { ColumnsType } from 'antd/es/table'
|
|
|
+import type { ColumnsType, TablePaginationConfig } from 'antd/es/table'
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
|
interface MintInfo {
|
|
|
@@ -83,13 +83,17 @@ function MyLPPageContent() {
|
|
|
message.destroy()
|
|
|
}
|
|
|
|
|
|
- const fetchLPList = async (adddr: string) => {
|
|
|
+ const fetchLPList = async (
|
|
|
+ adddr: string,
|
|
|
+ pagination?: { page: number; pageSize: number }
|
|
|
+ ) => {
|
|
|
if (!adddr) return
|
|
|
-
|
|
|
+ const newPage = pagination?.page || page
|
|
|
+ const newPageSize = pagination?.pageSize || pageSize
|
|
|
setLoading(true)
|
|
|
try {
|
|
|
const response = await fetch(
|
|
|
- `/api/my-lp?userAddress=${encodeURIComponent(adddr)}&page=${page}&pageSize=${pageSize}`
|
|
|
+ `/api/my-lp?userAddress=${encodeURIComponent(adddr)}&page=${newPage}&pageSize=${newPageSize}`
|
|
|
)
|
|
|
const data = await response.json()
|
|
|
const { positions, total, poolMap } = data.result?.data
|
|
|
@@ -444,10 +448,11 @@ function MyLPPageContent() {
|
|
|
showTotal: (total) => `共 ${total} 条记录`,
|
|
|
total: total,
|
|
|
}}
|
|
|
- onChange={(pagination) => {
|
|
|
- setPage(pagination.current || 1)
|
|
|
- setPageSize(pagination.pageSize || 50)
|
|
|
- fetchLPList(userAddress)
|
|
|
+ onChange={(pagination: TablePaginationConfig) => {
|
|
|
+ fetchLPList(userAddress, {
|
|
|
+ page: pagination.current || 1,
|
|
|
+ pageSize: pagination.pageSize || 50,
|
|
|
+ })
|
|
|
}}
|
|
|
/>
|
|
|
</Spin>
|