Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Not display page list count badge in trash page #7600

Merged
merged 2 commits into from
Apr 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions apps/app/src/components/PageSideContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 (
<>
Expand All @@ -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/*': https://github.com/weseek/growi/pull/7600 */}
{ !isTrash ? <CountBadge count={page?.descendantCount} offset={1} /> : <div className='px-2'></div>}
</button>
)}
</div>
Expand Down