import React, {Component} from 'react';
import {View, Text, TextInput, TouchableOpacity, Platform} from 'react-native';
import {colors} from '../assets/styles/colors-theme';
import {width, height} from '../services/screen';

class CustomTextInput extends Component {
  render() {
    return (
      <View
        style={{
          backgroundColor: 'white',
          height: 50,
          borderRadius: 15,
          width: width - 100,
          justifyContent: 'center',
          marginTop: 20,
          borderWidth: 1,
          borderColor: colors.line2Color,
        }}>
        <TextInput
          underlineColorAndroid="rgba(0,0,0,0)"
          keyboardType={this.props.keyboardType}
          onChangeText={this.props.onChangeText}
          secureTextEntry={this.props.secureTextEntry}
          placeholderStyle={{fontWeight: 'bold'}}
          // placeholderTextColor={colors.titleColor}
          ref={input => this.props.inputRef && this.props.inputRef(input)}
          returnKeyType={this.props.returnKeyType}
          onSubmitEditing={
            this.props.onSubmitEditing && this.props.onSubmitEditing
          }
          onFocus={this.props.onFocus}
          placeholder={this.props.title}
          value={this.props.content}
          style={{
            color: colors.inputText,
            fontSize: 14,

            marginBottom: Platform.OS === 'ios' ? 3 : 0,
            paddingVertical: 0,
            marginLeft: 15,
          }}
        />
      </View>
    );
  }
}
export default CustomTextInput;
