Skip to content

Instantly share code, notes, and snippets.

@vietnogi
Created January 7, 2016 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vietnogi/b4e5aa8ace1fe721edd9 to your computer and use it in GitHub Desktop.
Save vietnogi/b4e5aa8ace1fe721edd9 to your computer and use it in GitHub Desktop.
var React = require("react");
module.exports = function (locals) {
var tags = [];
var locals_for_with = locals || {};
(function(checked, label, onChange) {
tags.push(React.createElement.apply(React, [ "div", {
className: "Checkbox flex middle"
} ].concat(function() {
var tags = [];
tags.push(React.createElement.apply(React, [ "button", {
type: "button",
onClick: onChange,
className: "clean"
} ].concat(function() {
var tags = [];
checked ? tags.push(React.createElement("div", {
className: "icon checkmark active"
})) : tags.push(React.createElement("div", {
className: "icon plus hollow"
}));
return tags;
}.call(this))));
label && tags.push(React.createElement("label", {
onClick: onChange
}, label));
return tags;
}.call(this))));
}).call(this, "checked" in locals_for_with ? locals_for_with.checked : typeof checked !== "undefined" ? checked : undefined, "label" in locals_for_with ? locals_for_with.label : typeof label !== "undefined" ? label : undefined, "onChange" in locals_for_with ? locals_for_with.onChange : typeof onChange !== "undefined" ? onChange : undefined);
if (tags.length === 1 && !Array.isArray(tags[0])) {
return tags.pop();
}
tags.unshift("div", null);
return React.createElement.apply(React, tags);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment