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
@@ -18,14 +18,14 @@ import React from 'react';
import SettingsIcon from '@material-ui/icons/Settings';
import { settingsRouteRef } from '../plugin';
import { SidebarItem } from '@backstage/core-components';
import { IconComponent } from '@backstage/core-plugin-api';
import { useRouteRef, IconComponent } from '@backstage/core-plugin-api';
type SettingsProps = {
icon?: IconComponent;
};
export const Settings = (props: SettingsProps) => {
const routePath = useRouteRef(settingsRouteRef);
const Icon = props.icon ? props.icon : SettingsIcon;
return <SidebarItem text="Settings" to={settingsRouteRef.path} icon={Icon} />;
return <SidebarItem text="Settings" to={routePath()} icon={Icon} />;
};