mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-06-03 06:35:42 -05:00
pagination bug fixed
This commit is contained in:
parent
ed563e302c
commit
fd6fdf6b3d
|
|
@ -8,7 +8,11 @@ interface PaginationProps {
|
|||
onChange: (page: number) => void
|
||||
}
|
||||
|
||||
const Pagination: React.FC<PaginationProps> = ({ pageCount, onChange }) => {
|
||||
const Pagination: React.FC<PaginationProps> = ({
|
||||
pageCount,
|
||||
onChange,
|
||||
currentPage,
|
||||
}) => {
|
||||
return (
|
||||
<ReactPaginate
|
||||
previousLabel={<>«</>}
|
||||
|
|
@ -18,7 +22,8 @@ const Pagination: React.FC<PaginationProps> = ({ pageCount, onChange }) => {
|
|||
pageCount={pageCount}
|
||||
marginPagesDisplayed={2}
|
||||
pageRangeDisplayed={3}
|
||||
onPageChange={({ selected }) => onChange(selected)}
|
||||
onPageChange={({ selected }) => onChange(selected + 1)}
|
||||
forcePage={currentPage - 1}
|
||||
containerClassName="pagination"
|
||||
pageClassName="page"
|
||||
previousClassName="page"
|
||||
|
|
|
|||
|
|
@ -98,6 +98,8 @@ const Top500BrowserPage: React.FC<RouteComponentProps> = () => {
|
|||
|
||||
const placements = data ? data.searchForPlacements.placements : []
|
||||
|
||||
console.log("forms.page", forms.page)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
|
|
@ -115,7 +117,7 @@ const Top500BrowserPage: React.FC<RouteComponentProps> = () => {
|
|||
</Box>
|
||||
</Flex>
|
||||
</Box>
|
||||
<Box mt="2em" mb="1em">
|
||||
<Box mt="1em">
|
||||
<Pagination
|
||||
currentPage={forms.page ?? 1}
|
||||
pageCount={data?.searchForPlacements.pageCount ?? 999}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user