Sha256: a6b9b189dce3d56586ff7369b1e2ec843cb03b693775577ca54a39650c23de75
Contents?: true
Size: 714 Bytes
Versions: 1
Compression:
Stored size: 714 Bytes
Contents
import * as Tags from "../../types/Tags"; type Props = { enabled: boolean; tag: string; dispatch: React.Dispatch<Tags.Action>; }; export default function Tag(props: Props) { const handleChange = () => { props.dispatch({ type: "toggleTag", payload: props.tag }); }; const 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> ); }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pages_core-3.15.5 | app/javascript/components/TagEditor/Tag.tsx |