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
@@ -180,6 +180,15 @@ export abstract class CatalogCategory extends (EventEmitter as new () => TypedEm
|
||||
return this.metadata.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the badge of this category.
|
||||
* Defaults to no badge.
|
||||
* The badge is displayed next to the Category name in the Catalog Category menu
|
||||
*/
|
||||
public getBadge(): React.ReactNode {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a filter for menu items of catalogAddMenu
|
||||
* @param fn The function that should return a truthy value if that menu item should be displayed
|
||||
|
||||
Reference in new issue
Block a user