Skip to content

Commit

Permalink
gitignore changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Sankhadeep committed Jan 13, 2017
1 parent 362893e commit e4a5fd8
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
Expand Down
78 changes: 78 additions & 0 deletions Components/Widgets/Icon/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/* @flow */
'use strict';

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

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 Icon extends NativeBaseComponent {

propTypes: {
style : React.PropTypes.object
}

contextTypes: {
theme: React.PropTypes.object
}

componentWillMount() {
switch(this.getTheme().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;
}
}

static getImageSource = FontAwesome.getImageSource

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 ref={c => this._root = c} {...this.prepareRootProps()}/>
);
}
}
78 changes: 78 additions & 0 deletions dist/Components/Widgets/Icon/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/Components/Widgets/Icon/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e4a5fd8

Please sign in to comment.