Dulce-Work-Schedule/2018.1-Dulce_App

View on GitHub
src/Components/IconButton.js

Summary

Maintainability
A
0 mins
Test Coverage
import {IconButton as styles} from './styles' ;
import React from 'react';
import {Text, View} from 'react-native';
import {Content, Button} from 'native-base';
import Icon from 'react-native-vector-icons/Entypo';

class IconButton extends React.Component {
  render() {
    return (
        <Content>
          <Button rounded
            style={this.props.style ? this.props.style : styles.container}
            onPress={() => this.props.onPress()}>
            {this.props.icon ? <View style={{flexDirection: 'row', alignItems: 'center'}}>
              <Icon name={this.props.icon} size={25} style={{paddingHorizontal: 15}} color='#fff' />
              <Text style={styles.text}>{this.props.text}</Text>
            </View>
              : <Text style={styles.text}>{this.props.text}</Text>
            }
          </Button>
        </Content>
    );
  }
}

export default IconButton;