mirror of
https://github.com/flarum/framework.git
synced 2024-12-03 07:33:36 +08:00
ab6c03c0cc
- Use JSX for templates - Docblock/comment everything - Mostly passes ESLint (still some work to do) - Lots of renaming, refactoring, etc. CSS hasn't been updated yet.
13 lines
401 B
JavaScript
13 lines
401 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-fw fa-' + name + ' ' + (attrs.className || '');
|
|
|
|
return <i {...attrs}/>;
|
|
}
|