react-fontawesome
Advanced tools
Comparing version 0.1.0 to 0.2.0
25
index.js
@@ -1,8 +0,8 @@ | ||
import React from 'react' | ||
var React = require('react') | ||
export default React.createClass({ | ||
module.exports = React.createClass({ | ||
propTypes: { | ||
name: React.PropTypes.string.isRequired, | ||
size: React.PropTypes.oneOf(['lg', '2x', '3x', '4x', '5x']), | ||
size: React.PropTypes.oneOf(['1x', '2x', '3x', '4x', '5x']), | ||
spin: React.PropTypes.bool, | ||
@@ -18,7 +18,7 @@ pulse: React.PropTypes.bool, | ||
render() { | ||
var className = `fa fa-${this.props.name}` | ||
render: function () { | ||
var className = 'fa fa-' + this.props.name | ||
if (this.props.size) { | ||
className += ` fa-${this.props.size}` | ||
className += ' fa-' + this.props.size | ||
} | ||
@@ -47,19 +47,22 @@ | ||
if (this.props.flip) { | ||
className += ` fa-flip-${this.props.flip}` | ||
className += ' fa-flip-' + this.props.flip | ||
} | ||
if (this.props.rotate) { | ||
className += ` fa-rotate-${this.props.rotate}` | ||
className += ' fa-rotate-' + this.props.rotate | ||
} | ||
if (this.props.stack) { | ||
className += ` fa-stack-${this.props.stack}` | ||
className += ' fa-stack-' + this.props.stack | ||
} | ||
if (this.props.className) { | ||
className += ` ${this.props.className}` | ||
className += ' ' + this.props.className | ||
} | ||
return <span {...this.props} className={className} /> | ||
var props = this.props; | ||
props.className = className; | ||
return React.createElement('span', props) | ||
} | ||
}) |
{ | ||
"name": "react-fontawesome", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "A React FontAwesome component.", | ||
@@ -5,0 +5,0 @@ "repository": { |
598036
16722