mirror of
https://github.com/quay/quay.git
synced 2026-01-26 06:21:37 +03:00
UI: Using organizationName variable and using isHidden to hide tabs (PROJQUAY-4553) (#1862)
* UI: Using organizationName variable and using isHidden to hide tabs (PROJQUAY-4553) * replacing visible with hidden for uniformity
This commit is contained in:
@@ -20,7 +20,7 @@ export default function Organization() {
|
||||
const {organizationName} = useParams();
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
|
||||
const {organization} = useOrganization(orgName)
|
||||
const {organization} = useOrganization(organizationName);
|
||||
|
||||
const [activeTabKey, setActiveTabKey] = useState<string>(
|
||||
searchParams.get('tab') || 'Repositories',
|
||||
@@ -38,18 +38,18 @@ export default function Organization() {
|
||||
{
|
||||
name: 'Repositories',
|
||||
component: <RepositoriesList organizationName={organizationName} />,
|
||||
visible: true,
|
||||
hidden: false,
|
||||
},
|
||||
{
|
||||
name: 'Robot accounts',
|
||||
component: <RobotAccountsList organizationName={organizationName} />,
|
||||
visible: organization.is_org_admin || organization.is_admin,
|
||||
hidden: !(organization.is_org_admin || organization.is_admin),
|
||||
|
||||
},
|
||||
{
|
||||
name: 'Settings',
|
||||
component: <Settings organizationName={organizationName} />,
|
||||
visible: organization.is_org_admin || organization.is_admin,
|
||||
hidden: !(organization.is_org_admin || organization.is_admin),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -69,17 +69,16 @@ export default function Organization() {
|
||||
padding={{default: 'noPadding'}}
|
||||
>
|
||||
<Tabs activeKey={activeTabKey} onSelect={onTabSelect}>
|
||||
{repositoriesSubNav.map((nav) => {
|
||||
nav.visible && (
|
||||
<Tab
|
||||
key={nav.name}
|
||||
eventKey={nav.name}
|
||||
title={<TabTitleText>{nav.name}</TabTitleText>}
|
||||
>
|
||||
{nav.component}
|
||||
</Tab>
|
||||
);
|
||||
})}
|
||||
{repositoriesSubNav.map((nav) => (
|
||||
<Tab
|
||||
key={nav.name}
|
||||
eventKey={nav.name}
|
||||
title={<TabTitleText>{nav.name}</TabTitleText>}
|
||||
isHidden={nav.hidden}
|
||||
>
|
||||
{nav.component}
|
||||
</Tab>
|
||||
))}
|
||||
</Tabs>
|
||||
</PageSection>
|
||||
</Page>
|
||||
|
||||
Reference in New Issue
Block a user