-
-
Notifications
You must be signed in to change notification settings - Fork 838
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert icon helper to Typescript (#2360)
- Loading branch information
1 parent
9be629c
commit 8c46b37
Showing
2 changed files
with
13 additions
and
12 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} />; | ||
} |