feat: Add ability to customize Read More button destination in MissingAnnotationEmptyState component

Signed-off-by: Sergey Shevchenko <shevchenko@simple.life>
This commit is contained in:
Sergey Shevchenko
2022-05-10 16:45:37 +03:00
parent 19a404f0a7
commit e210c0cab8
2 changed files with 11 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Add ability to customize `Read More` destination with `readMoreUrl` prop for `MissingAnnotationEmptyState` component.
@@ -37,6 +37,7 @@ spec:
type Props = {
annotation: string;
readMoreUrl?: string;
};
export type MissingAnnotationEmptyStateClassKey = 'code';
@@ -53,7 +54,10 @@ const useStyles = makeStyles<BackstageTheme>(
);
export function MissingAnnotationEmptyState(props: Props) {
const { annotation } = props;
const { annotation, readMoreUrl } = props;
const url =
readMoreUrl ||
'https://backstage.io/docs/features/software-catalog/well-known-annotations';
const classes = useStyles();
const description = (
<>
@@ -81,11 +85,7 @@ export function MissingAnnotationEmptyState(props: Props) {
customStyle={{ background: 'inherit', fontSize: '115%' }}
/>
</div>
<Button
color="primary"
component={Link}
to="https://backstage.io/docs/features/software-catalog/well-known-annotations"
>
<Button color="primary" component={Link} to={url}>
Read more
</Button>
</>