Added condition for pagination
Signed-off-by: Aj-vrod <ammyvrodriguez@hotmail.com>
This commit is contained in:
@@ -83,13 +83,15 @@ const SearchResultList = ({ results }: SearchResultSet) => {
|
||||
}
|
||||
})}
|
||||
</List>
|
||||
<Pagination
|
||||
count={pageAmount}
|
||||
page={page}
|
||||
onChange={changePage}
|
||||
showFirstButton
|
||||
showLastButton
|
||||
/>
|
||||
{pageAmount > 1 && (
|
||||
<Pagination
|
||||
count={pageAmount}
|
||||
page={page}
|
||||
onChange={changePage}
|
||||
showFirstButton
|
||||
showLastButton
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -145,13 +145,14 @@ export const CatalogTable = ({ columns, actions }: CatalogTableProps) => {
|
||||
if (typeColumn) {
|
||||
typeColumn.hidden = !showTypeColumn;
|
||||
}
|
||||
const showPagination = rows.length > 20;
|
||||
|
||||
return (
|
||||
<Table<EntityRow>
|
||||
isLoading={loading}
|
||||
columns={columns || defaultColumns}
|
||||
options={{
|
||||
paging: true,
|
||||
paging: showPagination,
|
||||
pageSize: 20,
|
||||
actionsColumnIndex: -1,
|
||||
loadingType: 'linear',
|
||||
|
||||
@@ -174,7 +174,7 @@ export const MembersListCard = (_props: {
|
||||
<InfoCard
|
||||
title={`Members (${members?.length || 0}${paginationLabel})`}
|
||||
subheader={`of ${displayName}`}
|
||||
actions={pagination}
|
||||
{...(nbPages <= 1 ? {} : { actions: pagination })}
|
||||
>
|
||||
<Grid container spacing={3}>
|
||||
{members && members.length > 0 ? (
|
||||
|
||||
Reference in New Issue
Block a user