Change hardcoded docs link to use route reference
- Specify Changelog Signed-off-by: tudi2d <phugenroth@googlemail.com>
This commit is contained in:
@@ -21,6 +21,7 @@ import { EntityName, parseEntityName } from '@backstage/catalog-model';
|
||||
import { Header, HeaderLabel, Link, useRouteRef } from '@backstage/core';
|
||||
import { TechDocsMetadata } from '../../types';
|
||||
import { EntityRefLink, entityRouteRef } from '@backstage/plugin-catalog-react';
|
||||
import { rootRouteRef } from '../../plugin';
|
||||
|
||||
type TechDocsPageHeaderProps = {
|
||||
entityId: EntityName;
|
||||
@@ -59,6 +60,8 @@ export const TechDocsPageHeader = ({
|
||||
ownerEntity = parseEntityName(owner, { defaultKind: 'group' });
|
||||
}
|
||||
|
||||
const docsRootLink = useRouteRef(rootRouteRef)();
|
||||
|
||||
const labels = (
|
||||
<>
|
||||
<HeaderLabel
|
||||
@@ -113,7 +116,7 @@ export const TechDocsPageHeader = ({
|
||||
siteDescription && siteDescription !== 'None' ? siteDescription : ''
|
||||
}
|
||||
type="Docs"
|
||||
typeLink="/docs"
|
||||
typeLink={docsRootLink}
|
||||
>
|
||||
{labels}
|
||||
</Header>
|
||||
|
||||
Reference in New Issue
Block a user