Skip to content

Commit

Permalink
IS_COMMUNITY: hide Distributions tab
Browse files Browse the repository at this point in the history
not display_repositories because you still need a place for the "how to configure CLI" info
but there's only one published distribution on community galaxy

No-Issue
  • Loading branch information
himdel committed Nov 17, 2023
1 parent 5a27620 commit 5851891
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
20 changes: 11 additions & 9 deletions src/components/headers/collection-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -697,15 +697,17 @@ export class CollectionHeader extends React.Component<IProps, IState> {
reduced,
),
},
{
active: active === 'distributions',
title: t`Distributions`,
link: formatPath(
Paths.collectionDistributionsByRepo,
pathParams,
reduced,
),
},
!IS_COMMUNITY
? {
active: active === 'distributions',
title: t`Distributions`,
link: formatPath(
Paths.collectionDistributionsByRepo,
pathParams,
reduced,
),
}
: null,
];

return <LinkTabs tabs={tabs} />;
Expand Down
4 changes: 3 additions & 1 deletion src/components/shared/link-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const renderTab = ({ link, title, active = false }) => (
// We're not using the Tab react component because they don't support links.
export const LinkTabs = ({ tabs }: IProps) => (
<div className='pf-c-tabs'>
<ul className='pf-c-tabs__list'>{tabs.map((tab) => renderTab(tab))}</ul>
<ul className='pf-c-tabs__list'>
{tabs.filter(Boolean).map((tab) => renderTab(tab))}
</ul>
</div>
);

0 comments on commit 5851891

Please sign in to comment.