mirror of https://github.com/fantasticit/think.git
client: use page for pagination
This commit is contained in:
parent
4148b63c67
commit
0630870d0a
|
@ -152,6 +152,7 @@ export const useAllPublicWikis = () => {
|
||||||
data,
|
data,
|
||||||
loading: isLoading,
|
loading: isLoading,
|
||||||
error,
|
error,
|
||||||
|
page,
|
||||||
setPage,
|
setPage,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -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>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Reference in New Issue