Skip to content

Instantly share code, notes, and snippets.

@bazo
Created July 16, 2015 12:12
Show Gist options
  • Save bazo/04a01ff4c3da98ca7fa8 to your computer and use it in GitHub Desktop.
Save bazo/04a01ff4c3da98ca7fa8 to your computer and use it in GitHub Desktop.
const renderBooleanFeature = (packages, title, feature) => {
let tds = [];
for (let $package of packages) {
const data = $package[1];
const code = $package[0];
if (data.hasOwnProperty(feature) && data[feature] === true) {
tds.push(
<td key={code+feature} className={code}>
<span className="glyphicon glyphicon-ok"></span>
</td>
);
} else {
tds.push(
<td key={code+feature} className={code}>
<span className="glyphicon glyphicon-minus"></span>
</td>
);
}
}
return (
<tr>
<td>{title}</td>
{tds}
</tr>
)
}
/*
when i put my mouse cursor next to { on lines 1, 4, 7, 13 and press enter to add new code a closing } bracket is added which breaks existing code
this is because of settings: editor: general: smart keys: enter: insert pair } is on by default
webstorm 10.0.4 build WS-141.1550
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment