diff options
Diffstat (limited to 'cmd/web/js/icon.jsx')
-rw-r--r-- | cmd/web/js/icon.jsx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cmd/web/js/icon.jsx b/cmd/web/js/icon.jsx new file mode 100644 index 0000000..53453bc --- /dev/null +++ b/cmd/web/js/icon.jsx | |||
@@ -0,0 +1,19 @@ | |||
1 | import React from 'react'; | ||
2 | import classnames from 'classnames'; | ||
3 | |||
4 | class Icon extends React.Component { | ||
5 | render = () => { | ||
6 | var className = null; | ||
7 | |||
8 | if (this.props.icon.startsWith('icon-')) { | ||
9 | className = classnames(this.props.icon, this.props.className); | ||
10 | return <i className={className}></i>; | ||
11 | } | ||
12 | |||
13 | className = classnames('bt', 'bt-' + this.props.icon, this.props.className); | ||
14 | return <i className={className} aria-hidden="true"></i>; | ||
15 | |||
16 | } | ||
17 | } | ||
18 | |||
19 | export default Icon; | ||