-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change style of delete & edit buttons on tags table
Signed-off-by: TalyaNeima <talya.brajtman@gmail.com>
- Loading branch information
1 parent
f389539
commit 4837443
Showing
1 changed file
with
62 additions
and
62 deletions.
There are no files selected for viewing
124 changes: 62 additions & 62 deletions
124
client/src/app/pages/controls/tags/components/tag-table.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,62 @@ | ||
import React from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { | ||
Table, | ||
Thead, | ||
Tr, | ||
Th, | ||
Tbody, | ||
Td, | ||
ActionsColumn, | ||
} from "@patternfly/react-table"; | ||
import { Tag, TagCategory } from "@app/api/models"; | ||
import "./tag-table.css"; | ||
import { universalComparator } from "@app/utils/utils"; | ||
|
||
export interface TabTableProps { | ||
tagCategory: TagCategory; | ||
onEdit: (tag: Tag) => void; | ||
onDelete: (tag: Tag) => void; | ||
} | ||
|
||
export const TagTable: React.FC<TabTableProps> = ({ | ||
tagCategory, | ||
onEdit, | ||
onDelete, | ||
}) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<Table borders={false} aria-label="Tag table" variant="compact" isNested> | ||
<Thead noWrap> | ||
<Tr> | ||
<Th>{t("terms.tagName")}</Th> | ||
<Td /> | ||
</Tr> | ||
</Thead> | ||
<Tbody> | ||
{(tagCategory.tags || []) | ||
.sort((a, b) => universalComparator(a.name, b.name)) | ||
.map((tag) => ( | ||
<Tr key={tag.name}> | ||
<Td>{tag.name}</Td> | ||
<Td isActionCell> | ||
<ActionsColumn | ||
items={[ | ||
{ | ||
title: t("actions.edit"), | ||
onClick: () => onEdit(tag), | ||
}, | ||
{ | ||
title: t("actions.delete"), | ||
onClick: () => onDelete(tag), | ||
}, | ||
]} | ||
/> | ||
</Td> | ||
</Tr> | ||
))} | ||
</Tbody> | ||
</Table> | ||
); | ||
}; | ||
import React from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { | ||
Table, | ||
Thead, | ||
Tr, | ||
Th, | ||
Tbody, | ||
Td, | ||
ActionsColumn, | ||
} from "@patternfly/react-table"; | ||
import { Tag, TagCategory } from "@app/api/models"; | ||
import "./tag-table.css"; | ||
import { universalComparator } from "@app/utils/utils"; | ||
|
||
export interface TabTableProps { | ||
tagCategory: TagCategory; | ||
onEdit: (tag: Tag) => void; | ||
onDelete: (tag: Tag) => void; | ||
} | ||
|
||
export const TagTable: React.FC<TabTableProps> = ({ | ||
tagCategory, | ||
onEdit, | ||
onDelete, | ||
}) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<Table borders={false} aria-label="Tag table" variant="compact" isNested> | ||
<Thead noWrap> | ||
<Tr> | ||
<Th>{t("terms.tagName")}</Th> | ||
<Td /> | ||
</Tr> | ||
</Thead> | ||
<Tbody> | ||
{(tagCategory.tags || []) | ||
.sort((a, b) => universalComparator(a.name, b.name)) | ||
.map((tag) => ( | ||
<Tr key={tag.name}> | ||
<Td>{tag.name}</Td> | ||
<Td isActionCell> | ||
<ActionsColumn | ||
items={[ | ||
{ | ||
title: t("actions.edit"), | ||
onClick: () => onEdit(tag), | ||
}, | ||
{ | ||
title: t("actions.delete"), | ||
onClick: () => onDelete(tag), | ||
}, | ||
]} | ||
/> | ||
</Td> | ||
</Tr> | ||
))} | ||
</Tbody> | ||
</Table> | ||
); | ||
}; |