Add optional badge to Catalog Category label (#5156)

* Add optional badge to Catalog Category label.

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>

* Don't render badge container if there is no badge. Change CatalogCategoryLabel interface.

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>

* Add badgeBackgroundColor CSS variable for extensions. Regenerate theme-vars.css.

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>

* Use category as prop in CatalogCategoryLabel

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
Panu Horsmalahti authored and GitHub committed 2022-04-06 15:20:41 +03:00
1 parent 66330485b1
commit ca21e0842a
8 files changed
+117 -4

No files matched your search

@@ -14,6 +14,7 @@ import { StylesProvider } from "@material-ui/core";
import { cssNames } from "../../utils";
import type { CatalogCategory } from "../../api/catalog-entity";
import { observer } from "mobx-react";
import { CatalogCategoryLabel } from "./catalog-category-label";
export interface CatalogMenuProps {
activeItem: string;
@@ -66,7 +67,7 @@ export const CatalogMenu = observer((props: CatalogMenuProps) => {
icon={getCategoryIcon(category)}
key={category.getId()}
nodeId={category.getId()}
label={category.metadata.name}
label={<CatalogCategoryLabel category={category}/>}
data-testid={`${category.getId()}-tab`}
onClick={() => props.onItemClick(category.getId())}
/>