From af01aa52b02c88fcccb911e3b19322bf3f23d3da Mon Sep 17 00:00:00 2001 From: Spectralitree Date: Sat, 6 Feb 2021 19:45:34 +0100 Subject: [PATCH] tweak pagination --- src/Components/ProfileList.js | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/Components/ProfileList.js b/src/Components/ProfileList.js index ab99fa36..50b7d6dc 100644 --- a/src/Components/ProfileList.js +++ b/src/Components/ProfileList.js @@ -172,15 +172,15 @@ export default function Memberlist() { - { currentPage === 1 ? : setCurrentPage(currentPage - 1)} />} - { currentPage < 3 ? "" : setCurrentPage(1)} active={1 === active}>{1}} - { currentPage < 4 ? "" :} - { currentPage > 1 ? setCurrentPage(currentPage - 1)}>{currentPage - 1} : "" } - setCurrentPage(currentPage)} active={currentPage === active}>{currentPage} - { currentPage < pageAmount ? setCurrentPage(currentPage + 1)}>{currentPage + 1} : "" } - { currentPage > pageAmount - 3 ? "" : } - { currentPage > pageAmount - 2 ? "" : setCurrentPage(pageAmount)} active={pageAmount === active}>{pageAmount}} - { currentPage === pageAmount ? : setCurrentPage(currentPage + 1)} />} + { currentPage === 1 ? : setCurrentPage(currentPage - 1)} />} + { currentPage < 3 ? "" : setCurrentPage(1)} active={1 === active}>{1}} + { currentPage < 4 ? "" : currentPage < 5 ? setCurrentPage(2)} active={2 === active}>{2} : } + { currentPage > 1 ? setCurrentPage(currentPage - 1)}>{currentPage - 1} : "" } + setCurrentPage(currentPage)} active={currentPage === active}>{currentPage} + { currentPage < pageAmount ? setCurrentPage(currentPage + 1)}>{currentPage + 1} : "" } + { currentPage > pageAmount - 3 ? "" : currentPage === pageAmount - 3 ? setCurrentPage(pageAmount - 1)} active={pageAmount - 1 === active}>{pageAmount - 1} : } + { currentPage > pageAmount - 2 ? "" : setCurrentPage(pageAmount)} active={pageAmount === active}>{pageAmount}} + { currentPage === pageAmount ? : setCurrentPage(currentPage + 1)} />} { isLoading ? : isError ? @@ -189,6 +189,19 @@ export default function Memberlist() { {memberList} + + + { currentPage === 1 ? : setCurrentPage(currentPage - 1)} />} + { currentPage < 3 ? "" : setCurrentPage(1)} active={1 === active}>{1}} + { currentPage < 4 ? "" : currentPage < 5 ? setCurrentPage(2)} active={2 === active}>{2} : } + { currentPage > 1 ? setCurrentPage(currentPage - 1)}>{currentPage - 1} : "" } + setCurrentPage(currentPage)} active={currentPage === active}>{currentPage} + { currentPage < pageAmount ? setCurrentPage(currentPage + 1)}>{currentPage + 1} : "" } + { currentPage > pageAmount - 3 ? "" : currentPage === pageAmount - 3 ? setCurrentPage(pageAmount - 1)} active={pageAmount - 1 === active}>{pageAmount - 1} : } + { currentPage > pageAmount - 2 ? "" : setCurrentPage(pageAmount)} active={pageAmount === active}>{pageAmount}} + { currentPage === pageAmount ? : setCurrentPage(currentPage + 1)} />} + + }