Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Corrected calculation of total pages so that 'Prev' and 'Next' button…
Browse files Browse the repository at this point in the history
…s are disabled when table contains less than 10 rows. (#611)
  • Loading branch information
MazurakIhor authored Oct 13, 2023
1 parent e925b22 commit f71bded
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/molecules/leaderboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Leaderboard: React.FC<Props> = ({ userId, list, isLoading, onLoad }) => {
const [pageNumber, setPageNumber] = useState(1);

const maxUsers = list[0]?.ranking.total;
const maxPage = maxUsers / PAGE_SIZE;
const maxPage = Math.ceil(maxUsers / PAGE_SIZE);

const onSort = (val: LeaderboardColumn) => {
// if click on current column ? change direction : set default direction
Expand Down

0 comments on commit f71bded

Please sign in to comment.