Skip to content

Commit

Permalink
Rewrite font icon in ES6
Browse files Browse the repository at this point in the history
  • Loading branch information
javivelasco committed Sep 19, 2015
1 parent f27be7a commit 4074852
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 20 deletions.
20 changes: 0 additions & 20 deletions components/font_icon/index.cjsx

This file was deleted.

37 changes: 37 additions & 0 deletions components/font_icon/index.jsx
@@ -0,0 +1,37 @@
/* global React */

import { addons } from 'react/addons';
import style from './style';

export default React.createClass({
mixins: [addons.PureRenderMixin],

displayName: 'FontIcon',

propTypes: {
className: React.PropTypes.string,
value: React.PropTypes.string
},

getDefaultProps () {
return {
className: ''
};
},

onClick (event) {
if (this.props.onClick) {
this.props.onClick(event);
}
},

render () {
return (
<span
data-react-toolbox='icon'
className={`${style.root} ${this.props.className} ${this.props.value}`}
onClick={this.props.onClick}
/>
);
}
});

0 comments on commit 4074852

Please sign in to comment.