aboutsummaryrefslogtreecommitdiffstats
path: root/packages/ui/src/icon/index.tsx
diff options
context:
space:
mode:
authorLibravatar vantezzen <properly@protonmail.com>2019-09-07 15:50:23 +0200
committerLibravatar vantezzen <properly@protonmail.com>2019-09-07 15:50:23 +0200
commite7a74514c1e7c3833dfdcf5900cb87f9e6e8354e (patch)
treeb8314e4155503b135dcb07e8b4a0e847e25c19cf /packages/ui/src/icon/index.tsx
parentUpdate CHANGELOG.md (diff)
parentUpdate CHANGELOG.md (diff)
downloadferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.tar.gz
ferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.tar.zst
ferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.zip
Merge branch 'master' of https://github.com/meetfranz/franz into franz-5.3.0
Diffstat (limited to 'packages/ui/src/icon/index.tsx')
-rw-r--r--packages/ui/src/icon/index.tsx12
1 files changed, 4 insertions, 8 deletions
diff --git a/packages/ui/src/icon/index.tsx b/packages/ui/src/icon/index.tsx
index e30d3396d..af467c085 100644
--- a/packages/ui/src/icon/index.tsx
+++ b/packages/ui/src/icon/index.tsx
@@ -1,4 +1,3 @@
1import * as mdiIcons from '@mdi/js';
2import MdiIcon from '@mdi/react'; 1import MdiIcon from '@mdi/react';
3import { Theme } from '@meetfranz/theme'; 2import { Theme } from '@meetfranz/theme';
4import classnames from 'classnames'; 3import classnames from 'classnames';
@@ -8,7 +7,7 @@ import injectStyle from 'react-jss';
8import { IWithStyle } from '../typings/generic'; 7import { IWithStyle } from '../typings/generic';
9 8
10interface IProps extends IWithStyle { 9interface IProps extends IWithStyle {
11 icon: keyof typeof mdiIcons; 10 icon: string;
12 size?: number; 11 size?: number;
13 className?: string; 12 className?: string;
14} 13}
@@ -27,16 +26,13 @@ class IconComponent extends Component<IProps> {
27 render() { 26 render() {
28 const { 27 const {
29 classes, 28 classes,
30 icon: iconName, 29 icon,
31 size, 30 size,
32 className, 31 className,
33 } = this.props; 32 } = this.props;
34 33
35 let icon = ''; 34 if (!icon) {
36 if (iconName && mdiIcons[iconName]) { 35 console.warn('No Icon specified');
37 icon = mdiIcons[iconName];
38 } else if (iconName && !mdiIcons[iconName]) {
39 console.warn(`Icon '${iconName}' was not found`);
40 } 36 }
41 37
42 return ( 38 return (