Explorar o código

Revert "Only load pagination if needed"

This reverts commit f5cccfe0f03e34a6122005468d6db6daf3e04dec.
arvid-e hai 4 meses
pai
achega
d5532005ec
Modificáronse 1 ficheiros con 10 adicións e 12 borrados
  1. 10 12
      apps/app/src/client/components/RecentActivity/RecentActivity.tsx

+ 10 - 12
apps/app/src/client/components/RecentActivity/RecentActivity.tsx

@@ -55,8 +55,8 @@ export const RecentActivity = (props: RecentActivityProps): JSX.Element => {
     }
   }, [paginatedData, error]);
 
-  const totalItemsCount = paginatedData?.totalDocs || 0;
-  const needsPagination = totalItemsCount > limit;
+  const totalPageCount = paginatedData?.totalDocs || 0;
+
 
   return (
     <div className="page-list-container-activity">
@@ -68,16 +68,14 @@ export const RecentActivity = (props: RecentActivityProps): JSX.Element => {
         ))}
       </ul>
 
-      {needsPagination && (
-        <PaginationWrapper
-          activePage={activePage}
-          changePage={handlePage}
-          totalItemsCount={totalItemsCount}
-          pagingLimit={limit}
-          align="center"
-          size="sm"
-        />
-      )}
+      <PaginationWrapper
+        activePage={activePage}
+        changePage={handlePage}
+        totalItemsCount={totalPageCount}
+        pagingLimit={limit}
+        align="center"
+        size="sm"
+      />
     </div>
   );
 };