From c5a82fc819b8b2006770c1fd68454d2e42d25f91 Mon Sep 17 00:00:00 2001 From: Adam Kunicki Date: Thu, 6 Feb 2025 16:39:46 -0800 Subject: [PATCH] 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 --- .changeset/late-hairs-kneel.md | 5 +++++ plugins/home-react/src/extensions.tsx | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/late-hairs-kneel.md diff --git a/.changeset/late-hairs-kneel.md b/.changeset/late-hairs-kneel.md new file mode 100644 index 0000000000..d9e2731b6d --- /dev/null +++ b/.changeset/late-hairs-kneel.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-home-react': patch +--- + +Don't render header divider on homepage cards if no title was specified. diff --git a/plugins/home-react/src/extensions.tsx b/plugins/home-react/src/extensions.tsx index 404b5752ea..71b17a81a4 100644 --- a/plugins/home-react/src/extensions.tsx +++ b/plugins/home-react/src/extensions.tsx @@ -47,7 +47,9 @@ export type RendererProps = { title?: string } & ComponentParts; /** * @public */ -export type CardExtensionProps = ComponentRenderer & { title?: string } & T; +export type CardExtensionProps = ComponentRenderer & { + title?: string; +} & T; /** * @public @@ -150,7 +152,7 @@ function CardExtension(props: CardExtensionComponentProps) { } const cardProps = { - ...(title && { title }), + ...(title && { title, divider: !!title }), ...(Settings && !isCustomizable ? { action: (