framework/js/lib/helpers/icon.js
Toby Zerner afc597c189 Remove fa-fw class from all icons
Often it is desirable to NOT have this class applied, and it is easier
to apply its styles if needed rather than un-apply it.
2017-07-22 11:45:42 +09:30

13 lines
395 B
JavaScript

/**
* The `icon` helper displays a FontAwesome icon. The fa-fw class is applied.
*
* @param {String} name The name of the icon class, without the `fa-` prefix.
* @param {Object} attrs Any other attributes to apply.
* @return {Object}
*/
export default function icon(name, attrs = {}) {
attrs.className = 'icon fa fa-' + name + ' ' + (attrs.className || '');
return <i {...attrs}/>;
}