Skip to content

Commit

Permalink
Merge pull request #466 from ertush/hotfix
Browse files Browse the repository at this point in the history
fix: Sorted the issue of page navigation buttons
  • Loading branch information
ertush authored Aug 28, 2024
2 parents b3c2772 + 2373f2b commit 4862bd5
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions pages/facilities/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -793,26 +793,24 @@ function FacilityHome (props){

<div className="flex items-center gap-2">




{
props?.current_page > 5 && (props?.count / 10) > 100 &&
// props?.current_page > 5 &&
Array(props?.current_page + 5).fill(0).map((_, i) => i+1).slice(props?.current_page - 6, props?.current_page + 5).map(i => (
<button className={`border p-1 px-2 flex font-semibold place-content-center rounded ${props?.current_page == i ? 'bg-blue-600 text-gray-50 border-blue-600': ' border-gray-800'}`} onClick={handlePageLoad}>
{i}
</button>
))
}

{
props?.current_page <= 5 && (props?.count / 10) > 100 &&
Array(10).fill(0).map((_, i) => i+1).slice(0, 10).map(i => (
<button className={`border p-1 px-2 flex font-semibold place-content-center rounded ${props?.current_page == i ? 'bg-blue-600 text-gray-50 border-blue-600': ' border-gray-800'}`} onClick={handlePageLoad}>
{i}
</button>
))
}
{/* {
props?.current_page <= 5 &&
Array(10).fill(0).map((_, i) => i+1).slice(0, 10).map(i => (
<button className={`border p-1 px-2 flex font-semibold place-content-center rounded ${props?.current_page == i ? 'bg-blue-600 text-gray-50 border-blue-600': ' border-gray-800'}`} onClick={handlePageLoad}>
{i}
</button>
))
} */}

</div>

</div>
Expand Down Expand Up @@ -945,7 +943,7 @@ export async function getServerSideProps(ctx) {

})

console.log({url})
// console.log({url})


let current_url = url + '&page_size=100'
Expand Down

0 comments on commit 4862bd5

Please sign in to comment.