Sha256: b5085d31b60722cc951b5422e3315959af4419af305352a1160607865b21b9d6

Contents?: true

Size: 1.02 KB

Versions: 27

Compression:

Stored size: 1.02 KB

Contents

const InputCheckbox = ({ label, name, checked, inline, isLast, onChange, disabled = false }) => {

  const id = name;

  const wrapperClassName = classNames({
    'next-input-wrapper': true,
    'inline': inline,
    'sr': !isLast
  });

  const labelClassName = classNames({
    'next-label': true,
    'next-label--switch': true,
    'inline': inline,
    'fw-normal': inline
  });

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

  return(
    <div className={wrapperClassName}>
      <label htmlFor={id} className={labelClassName}>{label}</label>
      <input type="hidden" value="0" name={name} />
      <input id={id} className="next-checkbox" type="checkbox" value="1" name={name} checked={checked} onChange={handleChange} disabled={disabled} />
      <span className="next-checkbox--styled">
        <svg className="next-icon next-icon--size-10 next-icon--blue checkmark">
          <use xmlns="http://www.w3.org/1999/xlink" xlinkHref="#next-checkmark" />
        </svg>
      </span>
    </div>
  )

};

Version data entries

27 entries across 27 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-checkbox.es6.jsx
disco_app-0.13.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.13.1 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.13.2 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.13.3 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.13.4 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.13.5 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.13.6 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.13.7 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.13.8 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.14.1 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.14.2 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.15.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.16.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.17.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.18.0 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.18.2 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.14.4 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.18.3 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx
disco_app-0.18.6 app/assets/javascripts/disco_app/components/ui-kit/forms/input-checkbox.es6.jsx