Created
January 7, 2016 00:35
-
-
Save vietnogi/c9aa45d693ee708e6c55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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