aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/js/icon.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web/js/icon.jsx')
-rw-r--r--cmd/web/js/icon.jsx19
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 @@
1import React from 'react';
2import classnames from 'classnames';
3
4class 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
19export default Icon;