import React, { Component } from 'react'
import { TouchableOpacity, View } from 'react-native'
import Icon from 'src/components/Icon'
import Text from 'src/components/Text';
export class CustomButton extends Component {
  
  render() {
    const props = this.props;

   
    return (
      <TouchableOpacity
        style={[styles.custom_button_container, this.props.style]}
        onPress={props.onPress}
        disabled={this.props.disabled == null ? false : this.props.disabled}
      >
        {props.iconName && <View style={styles.icon}>
          <Icon name={props.iconName} size={16} color={props.iconColor || 'white'}> </Icon>
        </View>
        }
        {props.title && <View style={styles.icon}>
          <Text style={{ color: props.colorText || '#FAFAFA' ,fontSize:props.sizeText||16}} > {props.title}  </Text>
        </View>
        }

      </TouchableOpacity>
    )

    
  }
}

const styles = {
  custom_button_container: {
    // flex:1,
    // flexDirection: 'row',
    height: 35,
    abckgroundColor: '#FF9500',
    borderRadius: 5,
    width: '100%',
    justifyContent: 'center',
    alignItems: 'center',
  },
  icon: {
    justifyContent: 'center',
    // alignItems: '',
    // flex: 1,
    paddingLeft: 5,
    paddingRight: 5
  },
}

