catalog: make the external createComponent route optional, hiding the button if it is not set

This commit is contained in:
Patrik Oldsberg
2021-02-25 17:39:20 +01:00
parent a3a2e23bc4
commit 264e204f02
2 changed files with 11 additions and 8 deletions
@@ -167,14 +167,16 @@ const CatalogPageContents = () => {
/>
<Content>
<ContentHeader title={selectedTab ?? ''}>
<Button
component={RouterLink}
variant="contained"
color="primary"
to={createComponentLink()}
>
Create Component
</Button>
{createComponentLink && (
<Button
component={RouterLink}
variant="contained"
color="primary"
to={createComponentLink()}
>
Create Component
</Button>
)}
{showAddExampleEntities && (
<Button
className={styles.buttonSpacing}
+1
View File
@@ -18,4 +18,5 @@ import { createExternalRouteRef } from '@backstage/core';
export const createComponentRouteRef = createExternalRouteRef({
id: 'create-component',
optional: true,
});