Created helper functions to determine the key and if a page is disabled on a progressive paginator

This commit is contained in:
Alejandro Celaya
2020-03-28 17:43:09 +01:00
parent bab3b252c1
commit d7da8521ce
3 changed files with 13 additions and 9 deletions

View File

@@ -21,3 +21,7 @@ export const progressivePagination = (currentPage, pageCount) => {
return pages;
};
export const keyForPage = (pageNumber, index) => pageNumber !== ELLIPSIS ? pageNumber : `${pageNumber}_${index}`;
export const isPageDisabled = (pageNumber) => pageNumber === ELLIPSIS;