diff --git a/.changeset/mean-squids-relax.md b/.changeset/mean-squids-relax.md new file mode 100644 index 0000000000..558b42fcfc --- /dev/null +++ b/.changeset/mean-squids-relax.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-home-react': patch +--- + +Make `title` optional when defining the `createCardExtension` diff --git a/plugins/home-react/api-report.md b/plugins/home-react/api-report.md index d6a2f92589..4806cf7be0 100644 --- a/plugins/home-react/api-report.md +++ b/plugins/home-react/api-report.md @@ -55,7 +55,7 @@ export type ComponentRenderer = { // @public export function createCardExtension(options: { - title: string; + title?: string; components: () => Promise; name?: string; description?: string; @@ -65,14 +65,14 @@ export function createCardExtension(options: { // @public (undocumented) export type RendererProps = { - title: string; + title?: string; } & ComponentParts; // @public (undocumented) export const SettingsModal: (props: { open: boolean; close: Function; - componentName: string; + componentName?: string; children: JSX.Element; }) => JSX.Element; ``` diff --git a/plugins/home-react/src/components/SettingsModal.tsx b/plugins/home-react/src/components/SettingsModal.tsx index ace9944f28..43cb16bb40 100644 --- a/plugins/home-react/src/components/SettingsModal.tsx +++ b/plugins/home-react/src/components/SettingsModal.tsx @@ -27,14 +27,16 @@ import { export const SettingsModal = (props: { open: boolean; close: Function; - componentName: string; + componentName?: string; children: JSX.Element; }) => { const { open, close, componentName, children } = props; return ( close()}> - Settings - {componentName} + + {componentName ? `Settings - ${componentName}` : 'Settings'} + {children}