diff --git a/app/satellites/Main.tsx b/app/satellites/Main.tsx index bbd34ec..e2f60f0 100644 --- a/app/satellites/Main.tsx +++ b/app/satellites/Main.tsx @@ -26,7 +26,7 @@ export const Main = () => { const [filteredValue, setFilteredValue] = useState([]) const [pagination, setPagination] = useState({ current: 1, - pageSize: 20, + pageSize: 10, }) const [mobileLocationRefId, setMobileLocationRefId] = useState(null) @@ -196,6 +196,7 @@ export const Main = () => { loading={ isSatellitesLoading } compact={ false } pagination={ pagination } + setPagination={ setPagination } filteredValue={ filteredValue } sorter={ (a, b) => { return a.name.localeCompare(b.name) diff --git a/app/satellites/SatelliteTable.tsx b/app/satellites/SatelliteTable.tsx index 3a38cb3..db0833d 100644 --- a/app/satellites/SatelliteTable.tsx +++ b/app/satellites/SatelliteTable.tsx @@ -7,7 +7,7 @@ import { CSSProperties, ReactNode, useState } from 'react' import { Icon } from '@iconify-icon/react' import { noto_sc, rubik } from '@/app/fonts' import { IconSpinner } from '@/components/Icon/IconSpinner' -import { Button, Select, SideSheet, Tooltip } from '@douyinfe/semi-ui' +import { Button, Pagination, Select, SideSheet, Tooltip } from '@douyinfe/semi-ui' import useSWR, { SWRConfig } from 'swr' import { ObserverLocationStore, SatelliteSighting } from '@/types/types' import Image from 'next/image' @@ -694,6 +694,7 @@ export const SatelliteTable = ({ loading, filteredValue, pagination, + setPagination, sorter, }: { satellites: Satellite[] @@ -706,6 +707,7 @@ export const SatelliteTable = ({ current: number pageSize: number }, + setPagination?: (pagination: { current: number, pageSize: number }) => void sorter?: ((a: Satellite, b: Satellite) => number) }) => { // const [timestamp, setTimestamp] = useState(dayjs().unix()) @@ -777,6 +779,27 @@ export const SatelliteTable = ({ +
+ { + setPagination?.({ + pageSize: pagination?.pageSize || 10, + ...pagination, + current: page, + }) + setTimeout(() => { + window?.scrollTo({ + behavior: 'smooth', + top: 0, + }) + }, 200) + } } + /> +
星历数据来源 SatNOGS DB | 卫星过境信息计算接口 diff --git a/components/MainDrawer.tsx b/components/MainDrawer.tsx index 8911e7d..d8a3da7 100644 --- a/components/MainDrawer.tsx +++ b/components/MainDrawer.tsx @@ -117,15 +117,13 @@ export default function MainDrawer({children, nav}: { ))} - -