all files / src/components/ TelInput.js

97.67% Statements 42/43
88.57% Branches 31/35
100% Functions 10/10
66.67% Lines 2/3
9 statements, 4 functions, 17 branches Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35                                                                    
import React, { Component, PropTypes } from 'react';
 
class TelInput extends Component {
  static propTypes = {
    className: PropTypes.string,
    disabled: PropTypes.bool,
    readonly: PropTypes.bool,
    fieldName: PropTypes.string,
    fieldId: PropTypes.string,
    value: PropTypes.string,
    handleInputChange: PropTypes.func,
    handleKeyPress: PropTypes.func,
    handleKeyUp: PropTypes.func,
  };
 
  render() {
    return (
      <input type="tel" autoComplete="off"
        className={this.props.className}
        disabled={this.props.disabled ? 'disabled' : false}
        readOnly={this.props.readonly ? 'readonly' : false}
        name={this.props.fieldName}
        id={this.props.fieldId}
        value={this.props.value}
        onChange={this.props.handleInputChange}
        onKeyPress={this.props.handleKeyPress}
        onKeyUp={this.props.handleKeyUp}
      />
    );
  }
}
 
export default TelInput;