Don't render header divider on homepage cards if no title was specified.

Some homepage cards would like to define their own header
for example, so that a title can be set dynamically.

Removing the divider with the divider prop provides a way to put
everything in the content area without an extraneous divider above.

The divider is usually not easily visible using the default theme,
however customized themes that may use a larger border-radius this
divider becomes visible and distracting.

Signed-off-by: Adam Kunicki <kunickiaj@gmail.com>
This commit is contained in:
Adam Kunicki
2025-02-06 16:39:46 -08:00
parent 5076f4999a
commit c5a82fc819
2 changed files with 9 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-home-react': patch
---
Don't render header divider on homepage cards if no title was specified.
+4 -2
View File
@@ -47,7 +47,9 @@ export type RendererProps = { title?: string } & ComponentParts;
/**
* @public
*/
export type CardExtensionProps<T> = ComponentRenderer & { title?: string } & T;
export type CardExtensionProps<T> = ComponentRenderer & {
title?: string;
} & T;
/**
* @public
@@ -150,7 +152,7 @@ function CardExtension<T>(props: CardExtensionComponentProps<T>) {
}
const cardProps = {
...(title && { title }),
...(title && { title, divider: !!title }),
...(Settings && !isCustomizable
? {
action: (