Skip to content

Commit

Permalink
feat(icomoon): Icomoon icons added
Browse files Browse the repository at this point in the history
  • Loading branch information
Hany Kumar authored and Hany Kumar committed Aug 5, 2020
1 parent 9aeae3f commit 69f58ea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Binary file added resources/fonts/icomoon.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions src/basic/Icon/selection.json

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions src/basic/IconNB.js
Expand Up @@ -16,12 +16,16 @@ import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
import Octicons from 'react-native-vector-icons/Octicons';
import SimpleLineIcons from 'react-native-vector-icons/SimpleLineIcons';
import Zocial from 'react-native-vector-icons/Zocial';
import { createIconSetFromIcoMoon } from 'react-native-vector-icons';

import icoMoonConfig from '../basic/Icon/selection.json';
import mapPropsToStyleNames from '../utils/mapPropsToStyleNames';

const Icomoon = createIconSetFromIcoMoon(icoMoonConfig);

class IconNB extends Component {
static contextTypes = {
theme: PropTypes.object
theme: PropTypes.object,
};

constructor(props) {
Expand Down Expand Up @@ -67,6 +71,9 @@ class IconNB extends Component {
case 'Foundation':
this.Icon = Foundation;
break;
case 'Icomoon':
this.Icon = Icomoon;
break;
case 'Ionicons':
this.Icon = Ionicons;
break;
Expand All @@ -91,7 +98,7 @@ class IconNB extends Component {
}

render() {
return <this.Icon ref={c => (this._root = c)} {...this.props} />;
return <this.Icon ref={(c) => (this._root = c)} {...this.props} />;
}
}

Expand All @@ -104,13 +111,14 @@ IconNB.propTypes = {
'FontAwesome',
'FontAwesome5',
'Foundation',
'Icomoon',
'Ionicons',
'MaterialCommunityIcons',
'MaterialIcons',
'Octicons',
'SimpleLineIcons',
'Zocial'
])
'Zocial',
]),
};

const StyledIconNB = connectStyle(
Expand Down

0 comments on commit 69f58ea

Please sign in to comment.