Sha256: 4f9d00c8fa0a254d63a3de0571cf32b696ba39603a715c7ca4a99a53cdd4353f

Contents?: true

Size: 1.2 KB

Versions: 53

Compression:

Stored size: 1.2 KB

Contents

class InputTextArea extends BaseInput {

  render() {
    const { errors, defaultValue, label, name, onChange, placeholder, helpMessage } = this.props;

    const wrapperClassName = classNames({
      'next-input-wrapper': true,
      'next-input-wrapper--is-error': this.hasError() 
    });

    const handleChange = (e) => {
      onChange(e.target.value);
    };

    let helpElement = null;
    if(helpMessage) {
      helpElement = <p className="next-input__help-text">{helpMessage}</p>;
    }

    return (
      <div className={wrapperClassName}>
        <label className="next-label" htmlFor={name}>{label}</label>
        <textarea
          className="next-textarea"
          defaultValue={defaultValue}
          name={name}
          onChange={handleChange}
          placeholder={placeholder}
        />
        {helpElement}
      </div>
    );
  }
};

InputTextArea.propTypes = {
  errors: React.PropTypes.object,
  defaultValue: React.PropTypes.string,
  label: React.PropTypes.string.isRequired,
  name: React.PropTypes.string.isRequired,
  onChange: React.PropTypes.func.isRequired,
  placeholder: React.PropTypes.string,
  helpMessage: React.PropTypes.string
};

InputTextArea.defaultProps = {
  errors: {},
};

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
disco_app-0.11.1 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.12.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.12.1 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.12.5 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.12.6 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.12.7 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.13.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.13.1 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.13.2 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.13.3 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.13.4 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.13.5 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.13.6 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.13.7 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.13.8 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.14.1 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.14.2 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.15.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.16.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.17.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx