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:
@@ -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';
|
||||
}>;
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user