Просмотр исходного кода

not display page list coune badge in trash

yukendev 3 лет назад
Родитель
Сommit
9eb1276dec
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      apps/app/src/components/PageSideContents.tsx

+ 5 - 2
apps/app/src/components/PageSideContents.tsx

@@ -14,7 +14,7 @@ import TableOfContents from './TableOfContents';
 import styles from './PageSideContents.module.scss';
 
 
-const { isTopPage, isUsersHomePage } = pagePathUtils;
+const { isTopPage, isUsersHomePage, isTrashPage } = pagePathUtils;
 
 
 export type PageSideContentsProps = {
@@ -32,6 +32,7 @@ export const PageSideContents = (props: PageSideContentsProps): JSX.Element => {
   const pagePath = page.path;
   const isTopPagePath = isTopPage(pagePath);
   const isUsersHomePagePath = isUsersHomePage(pagePath);
+  const isTrash = isTrashPage(pagePath);
 
   return (
     <>
@@ -48,7 +49,9 @@ export const PageSideContents = (props: PageSideContentsProps): JSX.Element => {
               <PageListIcon />
             </div>
             {t('page_list')}
-            <CountBadge count={page?.descendantCount} offset={1} />
+
+            {/* Do not display CountBadge if '/trash/*' */}
+            { !isTrash ? <CountBadge count={page?.descendantCount} offset={1} /> : <div className='px-2'></div>}
           </button>
         )}
       </div>