Rename SubRoute to SettingsLayoutRouteProps

Signed-off-by: Nikita Karpukhin <nikita.karpukhin@scout24.com>
This commit is contained in:
Nikita Karpukhin
2022-11-10 17:19:57 +01:00
parent 2b35cf99f9
commit fde99df4c7
3 changed files with 9 additions and 6 deletions
@@ -28,7 +28,7 @@ import {
} from '@backstage/core-plugin-api';
/** @public */
export type SubRoute = {
export type SettingsLayoutRouteProps = {
path: string;
title: string;
children: JSX.Element;
@@ -37,7 +37,7 @@ export type SubRoute = {
const dataKey = 'plugin.user-settings.settingsLayoutRoute';
const Route: (props: SubRoute) => null = () => null;
const Route: (props: SettingsLayoutRouteProps) => null = () => null;
attachComponentData(Route, dataKey, true);
// This causes all mount points that are discovered within this route to use the path of the route itself
@@ -64,7 +64,7 @@ export const SettingsLayout = (props: SettingsLayoutProps) => {
withStrictError:
'Child of SettingsLayout must be an SettingsLayout.Route',
})
.getElements<SubRoute>()
.getElements<SettingsLayoutRouteProps>()
.map(child => child.props),
);
@@ -14,5 +14,8 @@
* limitations under the License.
*/
export type { SettingsLayoutProps, SubRoute } from './SettingsLayout';
export type {
SettingsLayoutProps,
SettingsLayoutRouteProps,
} from './SettingsLayout';
export { SettingsLayout } from './SettingsLayout';