Skip to content

Commit

Permalink
style pagination ok
Browse files Browse the repository at this point in the history
  • Loading branch information
MelanieSarrouy committed Nov 26, 2021
1 parent 5dd62b8 commit 0fd8bd6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/components/table/Pagination.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import {
} from '../../styles/components/table/pagination'

const Pagination = ({ setPage, page, pageCount, pageCountRange }) => {
console.log(page)
console.log(pageCount)
console.log(pageCountRange)

return (
<DivPagination>
Expand All @@ -27,7 +24,7 @@ const Pagination = ({ setPage, page, pageCount, pageCountRange }) => {
)}

{pageCountRange.map((index) => {
if (page === pageCountRange[index + 1]) {
if ((page === pageCountRange[index + 1]) || (page -1 === pageCountRange[index])) {
return (
<ButtonNumber
backgroundColor={colors.primary}
Expand Down
1 change: 1 addition & 0 deletions src/pages/EmployeesList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const EmployeesList = () => {
for (let i = 0; i < pageCount; i++) {
pageCountRange.push(i)
}

const employeesToDisplay = employees.slice(firstDataOnPage, lastDataOnPage)
const handleChange = (e) => {
setEntries(e.target.value)
Expand Down

0 comments on commit 0fd8bd6

Please sign in to comment.