mirror of
https://github.com/flarum/framework.git
synced 2024-12-04 00:03:37 +08:00
afc597c189
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.
13 lines
395 B
JavaScript
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}/>;
|
|
}
|