diff options
Diffstat (limited to 'packages/ui/src/icon/index.tsx')
-rw-r--r-- | packages/ui/src/icon/index.tsx | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/packages/ui/src/icon/index.tsx b/packages/ui/src/icon/index.tsx deleted file mode 100644 index 9753b399c..000000000 --- a/packages/ui/src/icon/index.tsx +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | import MdiIcon from '@mdi/react'; | ||
2 | import classnames from 'classnames'; | ||
3 | import { Component } from 'react'; | ||
4 | import injectStyle from 'react-jss'; | ||
5 | |||
6 | import { Theme } from '../../../theme'; | ||
7 | import { IWithStyle } from '../typings/generic'; | ||
8 | |||
9 | interface IProps extends IWithStyle { | ||
10 | icon: string; | ||
11 | size?: number; | ||
12 | className?: string; | ||
13 | } | ||
14 | |||
15 | const styles = (theme: Theme) => ({ | ||
16 | icon: { | ||
17 | fill: theme.colorText, | ||
18 | }, | ||
19 | }); | ||
20 | |||
21 | class IconComponent extends Component<IProps> { | ||
22 | public static defaultProps = { | ||
23 | size: 1, | ||
24 | }; | ||
25 | |||
26 | render() { | ||
27 | const { classes, icon, size, className } = this.props; | ||
28 | |||
29 | if (!icon) { | ||
30 | console.warn('No Icon specified'); | ||
31 | } | ||
32 | |||
33 | return ( | ||
34 | <MdiIcon | ||
35 | path={icon} | ||
36 | size={size} | ||
37 | className={classnames({ | ||
38 | [classes.icon]: true, | ||
39 | [`${className}`]: className, | ||
40 | })} | ||
41 | /> | ||
42 | ); | ||
43 | } | ||
44 | } | ||
45 | |||
46 | export const Icon = injectStyle(styles)(IconComponent); | ||