mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
refactor(containers): migrate create view to react [EE-2307] (#9175)
This commit is contained in:
parent
bc0050a7b4
commit
d970f0e2bc
71 changed files with 2612 additions and 1399 deletions
17
app/react/components/NavTabs/NavContainer.tsx
Normal file
17
app/react/components/NavTabs/NavContainer.tsx
Normal file
|
@ -0,0 +1,17 @@
|
|||
import clsx from 'clsx';
|
||||
import { PropsWithChildren } from 'react';
|
||||
|
||||
export function NavContainer({ children }: PropsWithChildren<unknown>) {
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
'rounded-lg border border-solid p-2',
|
||||
'border-gray-5 bg-gray-2',
|
||||
'th-dark:border-gray-neutral-8 th-dark:bg-gray-iron-10',
|
||||
'th-highcontrast:border-white th-highcontrast:bg-black'
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -14,6 +14,8 @@ interface Props<T extends string | number> {
|
|||
selectedId?: T;
|
||||
onSelect?(id: T): void;
|
||||
disabled?: boolean;
|
||||
type?: 'tabs' | 'pills';
|
||||
justified?: boolean;
|
||||
}
|
||||
|
||||
export function NavTabs<T extends string | number = string>({
|
||||
|
@ -21,12 +23,16 @@ export function NavTabs<T extends string | number = string>({
|
|||
selectedId,
|
||||
onSelect = () => {},
|
||||
disabled,
|
||||
type = 'tabs',
|
||||
justified = false,
|
||||
}: Props<T>) {
|
||||
const selected = options.find((option) => option.id === selectedId);
|
||||
|
||||
return (
|
||||
<div className="nav-container">
|
||||
<ul className="nav nav-tabs">
|
||||
<div>
|
||||
<ul
|
||||
className={clsx('nav', `nav-${type}`, { 'nav-justified': justified })}
|
||||
>
|
||||
{options.map((option) => (
|
||||
<li
|
||||
className={clsx({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue