mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
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:
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())}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user