/* @flow */
'use strict';

import React from 'react';
import NativeBaseComponent from '../Base/NativeBaseComponent';
import computeProps from '../../Utils/computeProps';

import variables from '../Themes/light';

import Ionicons from 'react-native-vector-icons/Ionicons';
import Entypo from 'react-native-vector-icons/Entypo';
import FontAwesome from 'react-native-vector-icons/FontAwesome';
import Foundation from 'react-native-vector-icons/Foundation';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
import Octicons from 'react-native-vector-icons/Octicons';
import Zocial from 'react-native-vector-icons/Zocial';

export default class IconNB extends NativeBaseComponent {
  
    propTypes: {
        style : React.PropTypes.object
    }
  
    contextTypes: {
      theme: React.PropTypes.object
    }
    
    componentWillMount() {
      switch(this.context.theme.iconFamily) {
        case 'Ionicons':
            this.Icon = Ionicons;
            break;
        case 'Entypo':
            this.Icon = Entypo;
            break;
        case 'FontAwesome':
            this.Icon = FontAwesome;
            break;
        case 'Foundation':
            this.Icon = Foundation;
            break;
        case 'MaterialIcons':
            this.Icon = MaterialIcons;
            break;
        case 'Octicons':
            this.Icon = Octicons;
            break;
        case 'Zocial':
            this.Icon = Zocial;
            break;
        default:
            this.Icon = Ionicons;
      }      
    }
  
    getInitialStyle() {
        return {
            icon: {
                fontSize: this.getTheme().iconFontSize,
                color: this.getContextForegroundColor()
            }
        }
    }
    prepareRootProps() {
        var defaultProps = {
            style: this.getInitialStyle().icon
        };

        return computeProps(this.props, defaultProps);

    }

    render() {
        return(
            <this.Icon {...this.prepareRootProps()}/>
        );
    }
}


@@ -168,50 +168,8 @@
 ';%0A%0A
-import variables from '../Themes/light';%0A%0A
 impo
@@ -219,24 +219,24 @@
 /Ionicons';%0A
+
 import Entyp
@@ -648,19 +648,17 @@
 onent %7B%0A
-  
 %0A
+
     prop
@@ -707,27 +707,25 @@
 bject%0A    %7D%0A
-  
 %0A
+
     contextT
@@ -774,21 +774,17 @@
 t%0A    %7D%0A
-    
 %0A
+
     comp
@@ -1468,24 +1468,16 @@
    %7D
-      
 %0A    %7D%0A
-  
 %0A
+
     
@@ -1953,11 +1953,10 @@
 ;%0A    %7D%0A
+
 %7D%0A
-%0A

remove import variables