From 2386de1d3c3f0761e620f11c9c40608bdfe01163 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Thu, 25 Feb 2021 23:28:42 -0500 Subject: [PATCH] Add org name to page title Signed-off-by: Adam Harvey --- .changeset/light-vans-hide.md | 5 ++++ .../ApiExplorerPage/ApiExplorerLayout.tsx | 29 +++++++++++-------- 2 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 .changeset/light-vans-hide.md diff --git a/.changeset/light-vans-hide.md b/.changeset/light-vans-hide.md new file mode 100644 index 0000000000..ccc1339959 --- /dev/null +++ b/.changeset/light-vans-hide.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-api-docs': patch +--- + +Add organization name to the API Explorer page title diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx index 0720ecf45b..b82166f4cd 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx @@ -14,20 +14,25 @@ * limitations under the License. */ -import { Header, Page } from '@backstage/core'; +import { Header, Page, useApi, configApiRef } from '@backstage/core'; import React from 'react'; type Props = { children?: React.ReactNode; }; - -export const ApiExplorerLayout = ({ children }: Props) => ( - -
- {children} - -); +export const ApiExplorerLayout = ({ children }: Props) => { + const configApi = useApi(configApiRef); + const generatedSubtitle = `${ + configApi.getString('organization.name') ?? 'Backstage' + } API Explorer`; + return ( + +
+ {children} + + ); +};