Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Commit

Permalink
fix: pagination page size
Browse files Browse the repository at this point in the history
  • Loading branch information
Lmmmmmm-bb committed Sep 22, 2022
1 parent 0f4345b commit 6e7a23f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/up-space-pagination/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import styles from './index.module.scss';

interface IUpSpacePaginationProps {
total: number;
pageSize: number;
onPrevClick: (page: number) => void;
onNextClick: (page: number) => void;
}

const UpSpacePagination: FC<IUpSpacePaginationProps> = (props) => {
const { total, onPrevClick, onNextClick } = props;
const lastPage = useMemo(() => Math.ceil(total / 10), [total]);
const { total, pageSize, onPrevClick, onNextClick } = props;
const lastPage = useMemo(() => Math.ceil(total / pageSize), [total]);
const [current, setCurrent] = useState(1);

const handlePrevClick = () => {
Expand Down
1 change: 1 addition & 0 deletions layouts/following/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const Following: FC = () => {
))}
</div>
<UpSpacePagination
pageSize={50}
total={total}
onNextClick={() => fetchFollow(page + 1)}
onPrevClick={() => fetchFollow(page - 1)}
Expand Down
1 change: 1 addition & 0 deletions layouts/up-space/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const UpSpace: FC = () => {
</div>
)}
<UpSpacePagination
pageSize={10}
total={totalVideo}
onPrevClick={handlePageClick}
onNextClick={handlePageClick}
Expand Down

0 comments on commit 6e7a23f

Please sign in to comment.