plugin-api: proper IconComponent type

Co-authored-by: Juan Lulkin <jmaiz@spotify.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-03-10 14:53:21 +01:00
parent 0d2bf483e2
commit 2ee6296a52
2 changed files with 16 additions and 2 deletions
+15 -2
View File
@@ -15,6 +15,19 @@
*/
import { ComponentType } from 'react';
// import { SvgIconProps } from '@material-ui/core';
export type IconComponent = ComponentType<any>;
/**
* IconComponent is the common icon type used throughout Backstage when
* working with and rendering generic icons, including the app system icons.
*
* The type is based on SvgIcon from MUI, but both do not what the plugin-api
* package to have a dependency on MUI, nor do we want the props to be as broad
* as the SvgIconProps interface.
*
* If you have the need to forward additional props from SvgIconProps, you can
* open an issue or submit a PR to the main Backstage repo. When doing so please
* also describe your use-case and reasoning of the addition.
*/
export type IconComponent = ComponentType<{
fontSize?: 'default' | 'small' | 'large';
}>;
+1
View File
@@ -17,6 +17,7 @@
export * from './apis';
export * from './app';
export * from './extensions';
export * from './icons';
export * from './plugin';
export * from './routing';
export * from './types';