Skip to content

Commit

Permalink
Reverting back to non-ES6 code to make more consumable.
Browse files Browse the repository at this point in the history
  • Loading branch information
danawoodman committed May 21, 2015
1 parent d0bb497 commit 93152f3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
25 changes: 14 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
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,
pulse: React.PropTypes.bool,
border: React.PropTypes.bool,
Expand All @@ -15,11 +15,11 @@ export default React.createClass({
stack: React.PropTypes.oneOf(['1x', '2x'])
},

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
}

if (this.props.spin) {
Expand All @@ -43,21 +43,24 @@ export default React.createClass({
}

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)
}
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-fontawesome",
"version": "0.1.0",
"version": "0.2.0",
"description": "A React FontAwesome component.",
"repository": {
"type": "git",
Expand Down

0 comments on commit 93152f3

Please sign in to comment.