Add Props Icon for Sidebar Item SidebarSearchField and Settings

Signed-off-by: Dede Hamzah <dehamzah@gmail.com>
This commit is contained in:
Dede Hamzah
2021-11-03 16:08:27 +07:00
parent f669d062bd
commit 4891a8f2e6
2 changed files with 12 additions and 9 deletions
@@ -18,13 +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';
export const Settings = () => {
return (
<SidebarItem
text="Settings"
to={settingsRouteRef.path}
icon={SettingsIcon}
/>
);
type SettingsProps = {
icon?: IconComponent;
};
export const Settings = (props: SettingsProps) => {
const Icon = props.icon ? props.icon : SettingsIcon;
return <SidebarItem text="Settings" to={settingsRouteRef.path} icon={Icon} />;
};