From 9b6da5747dff53949d703b2abd7efa252c07715e Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Thu, 11 Jan 2024 09:47:37 +0000 Subject: [PATCH] chore: Improve paging (#3265) --- frontend/web/components/Paging.js | 46 ++++++++++++++------- frontend/web/styles/components/_paging.scss | 29 ++++++++++--- 2 files changed, 54 insertions(+), 21 deletions(-) diff --git a/frontend/web/components/Paging.js b/frontend/web/components/Paging.js index 309fde7c72d4..cd7537cb880e 100644 --- a/frontend/web/components/Paging.js +++ b/frontend/web/components/Paging.js @@ -30,15 +30,25 @@ export default class Paging extends PureComponent { (currentIndex || currentIndex + 1) + spaceBetween, ) const range = _.range(from, to) - const noPages = range.length < 2 + const noPages = range.length < 1 if (noPages && !(paging.next || paging.previous)) { return null } return ( - + + {!!paging.count && ( + + {currentIndex * paging.pageSize + 1}- + {Math.min((currentIndex + 1) * paging.pageSize, paging.count)} of{' '} + {paging.count} + + )}