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.16.1.pre.sidekiq.pre.6.pre.release app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.9.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.9.1 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.9.2 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.9.3 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.9.4 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.9.5 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.9.6 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.9.7 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.9.8 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.9.9 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.9.10 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.9.11 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.10.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.10.1 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.10.2 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.10.3 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.10.4 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.10.5 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
disco_app-0.11.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx