From 67550c6b99f50c795bc72ca28866397a0bce0616 Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Wed, 6 Jul 2022 13:21:41 +0200 Subject: [PATCH] Incorporated the feedback. Signed-off-by: bnechyporenko --- .../src/components/CatalogPage/DefaultCatalogPage.tsx | 11 +++-------- plugins/catalog/src/options.ts | 5 +++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx index f06bbc8acd..39c19d717a 100644 --- a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx @@ -23,12 +23,7 @@ import { TableColumn, TableProps, } from '@backstage/core-components'; -import { - configApiRef, - useApi, - usePluginOptions, - useRouteRef, -} from '@backstage/core-plugin-api'; +import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; import { CatalogFilterLayout, EntityLifecyclePicker, @@ -44,7 +39,7 @@ import React from 'react'; import { createComponentRouteRef } from '../../routes'; import { CatalogTable, CatalogTableRow } from '../CatalogTable'; import { CatalogKindHeader } from '../CatalogKindHeader'; -import { CatalogPluginOptions } from '../../options'; +import { useCatalogPluginOptions } from '../../options'; /** * Props for root catalog pages. @@ -71,7 +66,7 @@ export function DefaultCatalogPage(props: DefaultCatalogPageProps) { useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage'; const createComponentLink = useRouteRef(createComponentRouteRef); - const { createButtonTitle } = usePluginOptions(); + const { createButtonTitle } = useCatalogPluginOptions(); return ( diff --git a/plugins/catalog/src/options.ts b/plugins/catalog/src/options.ts index 5b0e0767e3..edf702ee0b 100644 --- a/plugins/catalog/src/options.ts +++ b/plugins/catalog/src/options.ts @@ -14,6 +14,11 @@ * limitations under the License. */ +import { usePluginOptions } from '@backstage/core-plugin-api'; + export type CatalogPluginOptions = { createButtonTitle: string; }; + +export const useCatalogPluginOptions = () => + usePluginOptions();