forked from pterolex/react-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFaIcon.jsx
More file actions
34 lines (28 loc) · 797 Bytes
/
FaIcon.jsx
File metadata and controls
34 lines (28 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* @jsx React.DOM
*/
'use strict';
var React = require('react');
var classNames = require('classnames');
require('font-awesome/css/font-awesome.min.css');
require('./FaIcon.less');
var FaIcon = React.createClass({
propTypes: {
type: React.PropTypes.string.isRequired,
onClick: React.PropTypes.func,
onTouchTap: React.PropTypes.func
},
render() {
var iconClass = classNames({
'WLC-FaIcon': true,
'fa': true,
'WLC-clickable': this.props.onClick || this.props.onTouchTap
});
return (
<i className={iconClass + ' fa-' + this.props.type}
onClick={this.props.onClick}
onTouchTap={this.props.onTouchTap} />
);
}
});
module.exports = FaIcon;