Changed side menu icons with us component

This commit is contained in:
mistikk 2018-11-02 12:19:48 +03:00
parent e70acb681f
commit 4e5a553d89
3 changed files with 7 additions and 6 deletions

View File

@ -31,7 +31,7 @@ class IconView extends Component {
};
_getIcon = () => {
const { iconType } = this.props;
const { iconType, children } = this.props;
const name = this._getIconName();
switch (iconType) {
@ -40,11 +40,11 @@ class IconView extends Component {
case 'FontAwesome':
return <FontAwesome {...this.props} />;
case 'SimpleLineIcons':
return <SimpleLineIcons {...this.props}>{this.props.children}</SimpleLineIcons>;
return <SimpleLineIcons {...this.props}>{children}</SimpleLineIcons>;
case 'MaterialCommunityIcons':
return (
<MaterialCommunityIcons name={name} {...this.props}>
{this.props.children}
{children}
</MaterialCommunityIcons>
);
default:

View File

@ -9,6 +9,7 @@ import { NumericKeyboard } from './numericKeyboard';
import { PinAnimatedInput } from './pinAnimatedInput';
import { SideMenu } from './sideMenu';
import Modal from './modal';
import Icon from './icon';
export {
Logo,
@ -24,4 +25,5 @@ export {
PinAnimatedInput,
SideMenu,
Modal,
Icon,
};

View File

@ -3,11 +3,10 @@ import { View, Text } from 'react-native';
import {
Thumbnail, List, ListItem, Container,
} from 'native-base';
import Icon from 'react-native-vector-icons/FontAwesome';
import LinearGradient from 'react-native-linear-gradient';
// Components
import { IconButton } from '../..';
import { Icon, IconButton } from '../..';
// Constants
import { default as MENU } from '../../../constants/sideMenuItems';
@ -129,7 +128,7 @@ class SideMenuView extends Component {
}
}}
>
{item.icon && <Icon style={styles.listItemIcon} name={item.icon} />}
{item.icon && <Icon iconType="FontAwesome" style={styles.listItemIcon} name={item.icon} />}
{item.image && (
<Thumbnail small style={styles.otherUserAvatar} source={item.image} />
)}