mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
fix(container): hide capabilities tab EE-6258 (#10540)
This commit is contained in:
parent
403fdf7ce3
commit
3964852fda
5 changed files with 58 additions and 34 deletions
|
@ -7,6 +7,7 @@ export interface Option<T extends string | number = string> {
|
|||
label: ReactNode;
|
||||
children?: ReactNode;
|
||||
id: T;
|
||||
hidden?: boolean;
|
||||
}
|
||||
|
||||
interface Props<T extends string | number> {
|
||||
|
@ -33,31 +34,34 @@ export function NavTabs<T extends string | number = string>({
|
|||
<ul
|
||||
className={clsx('nav', `nav-${type}`, { 'nav-justified': justified })}
|
||||
>
|
||||
{options.map((option) => (
|
||||
<li
|
||||
className={clsx({
|
||||
active: option.id === selectedId,
|
||||
[styles.parent]: !option.children,
|
||||
disabled,
|
||||
})}
|
||||
key={option.id}
|
||||
>
|
||||
{/* rule disabled because `nav-tabs` requires an anchor */}
|
||||
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
||||
<a
|
||||
onClick={() => handleSelect(option)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
handleSelect(option);
|
||||
}
|
||||
}}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
>
|
||||
{option.label}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
{options.map(
|
||||
(option) =>
|
||||
!option.hidden && (
|
||||
<li
|
||||
className={clsx({
|
||||
active: option.id === selectedId,
|
||||
[styles.parent]: !option.children,
|
||||
disabled,
|
||||
})}
|
||||
key={option.id}
|
||||
>
|
||||
{/* rule disabled because `nav-tabs` requires an anchor */}
|
||||
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
||||
<a
|
||||
onClick={() => handleSelect(option)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
handleSelect(option);
|
||||
}
|
||||
}}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
>
|
||||
{option.label}
|
||||
</a>
|
||||
</li>
|
||||
)
|
||||
)}
|
||||
</ul>
|
||||
{selected && selected.children && (
|
||||
<div className="tab-content mt-3">{selected.children}</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue