Created
July 16, 2015 12:12
-
-
Save bazo/04a01ff4c3da98ca7fa8 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
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