Преглед изворни кода

undisplay a pagination and mark as read button

kaori пре 4 година
родитељ
комит
f8b721e2a6
1 измењених фајлова са 16 додато и 12 уклоњено
  1. 16 12
      packages/app/src/components/InAppNotification/InAppNotificationPage.tsx

+ 16 - 12
packages/app/src/components/InAppNotification/InAppNotificationPage.tsx

@@ -59,7 +59,7 @@ const InAppNotificationPageBody: FC<Props> = (props) => {
 
 
     return (
     return (
       <>
       <>
-        {status === InAppNotificationStatuses.STATUS_UNOPENED
+        {(status === InAppNotificationStatuses.STATUS_UNOPENED && notificationData.totalDocs > 0)
       && (
       && (
         <div className="mb-2 d-flex justify-content-end">
         <div className="mb-2 d-flex justify-content-end">
           <button
           <button
@@ -70,18 +70,22 @@ const InAppNotificationPageBody: FC<Props> = (props) => {
             {t('in_app_notification.mark_all_as_read')}
             {t('in_app_notification.mark_all_as_read')}
           </button>
           </button>
         </div>
         </div>
-      )
-        }
-
+      )}
         <InAppNotificationList inAppNotificationData={notificationData} />
         <InAppNotificationList inAppNotificationData={notificationData} />
-        <PaginationWrapper
-          activePage={activePage}
-          changePage={setAllNotificationPageNumber}
-          totalItemsCount={notificationData.totalDocs}
-          pagingLimit={notificationData.limit}
-          align="center"
-          size="sm"
-        />
+
+        {notificationData.totalDocs > 0
+          && (
+
+            <PaginationWrapper
+              activePage={activePage}
+              changePage={setAllNotificationPageNumber}
+              totalItemsCount={notificationData.totalDocs}
+              pagingLimit={notificationData.limit}
+              align="center"
+              size="sm"
+            />
+          )
+        }
       </>
       </>
     );
     );
   };
   };