Sha256: d6e6d582ef1d8e8c3253d2b905e8db7135e6f73b1b24794ad4b375c9f8e2c905

Contents?: true

Size: 712 Bytes

Versions: 15

Compression:

Stored size: 712 Bytes

Contents

import React from "react";
import PropTypes from "prop-types";

export default function Tag(props) {
  const handleChange = () => {
    props.toggleEnabled(props.tag);
  };

  let classes = ["tag"];
  if (props.enabled) {
    classes.push("enabled");
  }

  return (
    <span className={classes.join(" ")}>
      <label className="check-box">
        <input type="checkbox"
               name={"tag-" + props.tag}
               value="1"
               checked={props.enabled}
               onChange={handleChange} />
        <span className="name">{props.tag}</span>
      </label>
    </span>
  );
}

Tag.propTypes = {
  enabled: PropTypes.bool,
  tag: PropTypes.string,
  toggleEnabled: PropTypes.func
};

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
pages_core-3.12.1 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.12.0 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.11.3 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.11.2 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.11.1 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.11.0 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.10.2 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.10.1 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.9.2 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.9.1 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.9.0 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.8.3 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.8.2 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.8.1 app/javascript/components/TagEditor/Tag.jsx
pages_core-3.8.0 app/javascript/components/TagEditor/Tag.jsx