mirror of
https://github.com/flarum/framework.git
synced 2025-05-23 07:09:57 +08:00
Massive JavaScript cleanup
- 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.
This commit is contained in:
@ -1,3 +1,12 @@
|
||||
export default function icon(icon) {
|
||||
return m('i.fa.fa-fw.fa-'+icon)
|
||||
/**
|
||||
* 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}/>;
|
||||
}
|
||||
|
Reference in New Issue
Block a user