chore: added some more deprecation fixes for the routeRefs

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-10-21 14:11:42 +02:00
parent 1332a98a01
commit 8b21788e96
9 changed files with 27 additions and 34 deletions
@@ -22,24 +22,23 @@ import {
TabbedLayout,
} from '@backstage/core-components';
import { Overview } from '../Overview';
import { buildsRouteRef, rootRouteRef } from '../../routes';
import { RouteRef, SubRouteRef } from '@backstage/core-plugin-api';
import { buildsRouteRef } from '../../routes';
import { BuildsPage } from '../BuildsPage';
export interface TabConfig {
routeRef: RouteRef | SubRouteRef;
path: string;
title: string;
component: ReactChild;
}
const TABS: TabConfig[] = [
{
routeRef: rootRouteRef,
path: '/',
title: 'Overview',
component: <Overview />,
},
{
routeRef: buildsRouteRef,
path: buildsRouteRef.path,
title: 'Builds',
component: <BuildsPage />,
},
@@ -53,11 +52,7 @@ export const XcmetricsLayout = () => (
</Header>
<TabbedLayout>
{TABS.map(tab => (
<TabbedLayout.Route
key={tab.routeRef.path}
path={tab.routeRef.path}
title={tab.title}
>
<TabbedLayout.Route key={tab.path} path={tab.path} title={tab.title}>
<Content>{tab.component}</Content>
</TabbedLayout.Route>
))}