From 159428615330e768ab5f2af8021452408d48dc37 Mon Sep 17 00:00:00 2001 From: Aj-vrod Date: Tue, 31 Aug 2021 09:43:56 +0200 Subject: [PATCH] Added condition for pagination Signed-off-by: Aj-vrod --- .../app/src/components/search/SearchPage.tsx | 16 +++++++++------- .../src/components/CatalogTable/CatalogTable.tsx | 3 ++- .../Cards/Group/MembersList/MembersListCard.tsx | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/app/src/components/search/SearchPage.tsx b/packages/app/src/components/search/SearchPage.tsx index cf4e610b80..9b0ae7eecf 100644 --- a/packages/app/src/components/search/SearchPage.tsx +++ b/packages/app/src/components/search/SearchPage.tsx @@ -83,13 +83,15 @@ const SearchResultList = ({ results }: SearchResultSet) => { } })} - + {pageAmount > 1 && ( + + )} ); }; diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx index c85a60c7c1..f293710847 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx @@ -145,13 +145,14 @@ export const CatalogTable = ({ columns, actions }: CatalogTableProps) => { if (typeColumn) { typeColumn.hidden = !showTypeColumn; } + const showPagination = rows.length > 20; return ( isLoading={loading} columns={columns || defaultColumns} options={{ - paging: true, + paging: showPagination, pageSize: 20, actionsColumnIndex: -1, loadingType: 'linear', diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx index 862fc51aa7..0642e80a7b 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx @@ -174,7 +174,7 @@ export const MembersListCard = (_props: { {members && members.length > 0 ? (