mirror of
https://github.com/flarum/framework.git
synced 2024-11-26 10:14:16 +08:00
Convert icon helper to Typescript (#2360)
This commit is contained in:
parent
2ec8b3670d
commit
15bd4f661b
|
@ -1,12 +0,0 @@
|
|||
/**
|
||||
* The `icon` helper displays an icon.
|
||||
*
|
||||
* @param {String} fontClass The full icon class, prefix and the icon’s name.
|
||||
* @param {Object} attrs Any other attributes to apply.
|
||||
* @return {Object}
|
||||
*/
|
||||
export default function icon(fontClass, attrs = {}) {
|
||||
attrs.className = 'icon ' + fontClass + ' ' + (attrs.className || '');
|
||||
|
||||
return <i {...attrs} />;
|
||||
}
|
13
framework/core/js/src/common/helpers/icon.tsx
Normal file
13
framework/core/js/src/common/helpers/icon.tsx
Normal file
|
@ -0,0 +1,13 @@
|
|||
import * as Mithril from 'mithril';
|
||||
|
||||
/**
|
||||
* The `icon` helper displays an icon.
|
||||
*
|
||||
* @param fontClass The full icon class, prefix and the icon’s name.
|
||||
* @param attrs Any other attributes to apply.
|
||||
*/
|
||||
export default function icon(fontClass: string, attrs: Mithril.Attributes = {}): Mithril.Vnode {
|
||||
attrs.className = 'icon ' + fontClass + ' ' + (attrs.className || '');
|
||||
|
||||
return <i {...attrs} />;
|
||||
}
|
Loading…
Reference in New Issue
Block a user