client: use page for pagination

This commit is contained in:
fantasticit 2022-06-14 22:28:34 +08:00
parent 4148b63c67
commit 0630870d0a
2 changed files with 3 additions and 2 deletions

View File

@ -152,6 +152,7 @@ export const useAllPublicWikis = () => {
data, data,
loading: isLoading, loading: isLoading,
error, error,
page,
setPage, setPage,
}; };
}; };

View File

@ -23,7 +23,7 @@ const { Title } = Typography;
const PAGESIZE = 12; const PAGESIZE = 12;
const Page: NextPage = () => { const Page: NextPage = () => {
const { data, loading, error, setPage } = useAllPublicWikis(); const { data, loading, error, page, setPage } = useAllPublicWikis();
return ( return (
<SingleColumnLayout> <SingleColumnLayout>
@ -62,7 +62,7 @@ const Page: NextPage = () => {
/> />
{data.total > PAGESIZE && ( {data.total > PAGESIZE && (
<div style={{ display: 'flex', justifyContent: 'center' }}> <div style={{ display: 'flex', justifyContent: 'center' }}>
<Pagination total={data.total} pageSize={PAGESIZE} onPageChange={setPage} /> <Pagination total={data.total} currentPage={page} pageSize={PAGESIZE} onPageChange={setPage} />
</div> </div>
)} )}
</> </>