From e1e46986d902adc4c19ee009016290f9733a7d61 Mon Sep 17 00:00:00 2001
From: Stefan Malzner <stefan@adlk.io>
Date: Mon, 5 Aug 2019 16:48:25 +0200
Subject: Enable tree shaking for icons

---
 packages/forms/src/button/index.tsx | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

(limited to 'packages/forms/src/button/index.tsx')

diff --git a/packages/forms/src/button/index.tsx b/packages/forms/src/button/index.tsx
index 9faedc8f1..b53c2da05 100644
--- a/packages/forms/src/button/index.tsx
+++ b/packages/forms/src/button/index.tsx
@@ -1,4 +1,3 @@
-import * as mdiIcons from '@mdi/js';
 import Icon from '@mdi/react';
 import { Theme } from '@meetfranz/theme';
 import classnames from 'classnames';
@@ -21,7 +20,7 @@ interface IProps extends IFormField, IWithStyle {
   stretch?: boolean;
   loaded?: boolean;
   busy?: boolean;
-  icon?: keyof typeof mdiIcons;
+  icon?: string;
   href?: string;
   target?: string;
 }
@@ -175,7 +174,7 @@ class ButtonComponent extends Component<IProps> {
       onClick,
       buttonType,
       loaded,
-      icon: iconName,
+      icon,
       busy: busyProp,
       href,
       target,
@@ -185,13 +184,6 @@ class ButtonComponent extends Component<IProps> {
       busy,
     } = this.state;
 
-    let icon = '';
-    if (iconName && mdiIcons[iconName]) {
-      icon = mdiIcons[iconName];
-    } else if (iconName && !mdiIcons[iconName]) {
-      console.warn(`Icon '${iconName}' was not found`);
-    }
-
     let showLoader = false;
     if (loaded) {
       showLoader = !loaded;
-- 
cgit v1.2.3-70-g09d2

