kaori 4 лет назад
Родитель
Сommit
94ecab541a
1 измененных файлов с 11 добавлено и 13 удалено
  1. 11 13
      packages/app/src/components/InAppNotification/InAppNotificationList.tsx

+ 11 - 13
packages/app/src/components/InAppNotification/InAppNotificationList.tsx

@@ -23,23 +23,21 @@ const InAppNotificationList: FC<Props> = (props: Props) => {
 
   const notifications = inAppNotificationData.docs;
 
-  const InAppNotificationList = () => {
-    return (
-      <>
-        {notifications.map((notification: IInAppNotification) => {
-          return (
-            <div className="d-flex flex-row" key={notification._id}>
-              <InAppNotificationElm notification={notification} />
-            </div>
-          );
-        })}
-      </>
-    );
+  const renderInAppNotificationList = () => {
+    const inAppNotificationList = notifications.map((notification: IInAppNotification) => {
+      return (
+        <div className="d-flex flex-row" key={notification._id}>
+          <InAppNotificationElm notification={notification} />
+        </div>
+      );
+    });
+
+    return inAppNotificationList;
   };
 
   return (
     <>
-      {notifications.length === 0 ? <>You had no notifications, yet.</> : <InAppNotificationList />}
+      {notifications.length === 0 ? <>You had no notifications, yet.</> : renderInAppNotificationList()}
     </>
   );
 };