فهرست منبع

125587 set condition in return

soumaeda 2 سال پیش
والد
کامیت
8c76af6db6
1فایلهای تغییر یافته به همراه11 افزوده شده و 13 حذف شده
  1. 11 13
      apps/app/src/components/PageList/PageListItemS.tsx

+ 11 - 13
apps/app/src/components/PageList/PageListItemS.tsx

@@ -32,22 +32,20 @@ export const PageListItemS = (props: PageListItemSProps): JSX.Element => {
     pagePathElement = <a className="text-break" href={page.path}>{pagePathElement}</a>;
   }
 
-  if (isNarrowView) {
-    pagePathElement = (
-      <div className={`${styles['page-list']}`}>
-        <div className="mx-2 page-title">
-          <Clamp lines={2}>
-            {pagePathElement}
-          </Clamp>
-        </div>
-      </div>
-    );
-  }
-
   return (
     <>
       <UserPicture user={page.lastUpdateUser} noLink={noLink} />
-      {pagePathElement}
+      {isNarrowView ? (
+        <div className={`${styles['page-list']}`}>
+          <div className="mx-2 page-title">
+            <Clamp lines={2}>
+              {pagePathElement}
+            </Clamp>
+          </div>
+        </div>
+      ) : (
+        { pagePathElement }
+      )}
       <span className="ml-2">
         <PageListMeta page={page} />
       </span>