Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-fontawesome

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-fontawesome - npm Package Compare versions

Comparing version 0.3.3 to 1.0.0

.babelrc

76

lib/index.js
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true

@@ -9,4 +9,2 @@ });

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = require('react');

@@ -16,2 +14,6 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
/**

@@ -35,3 +37,3 @@ * A React component for the font-awesome icon library.

*/
exports['default'] = _react2['default'].createClass({
exports.default = _react2.default.createClass({

@@ -41,52 +43,66 @@ displayName: 'FontAwesome',

propTypes: {
border: _react2['default'].PropTypes.bool,
className: _react2['default'].PropTypes.string,
fixedWidth: _react2['default'].PropTypes.bool,
flip: _react2['default'].PropTypes.oneOf(['horizontal', 'vertical']),
inverse: _react2['default'].PropTypes.bool,
name: _react2['default'].PropTypes.string.isRequired,
pulse: _react2['default'].PropTypes.bool,
rotate: _react2['default'].PropTypes.oneOf([90, 180, 270]),
size: _react2['default'].PropTypes.oneOf(['lg', '2x', '3x', '4x', '5x']),
spin: _react2['default'].PropTypes.bool,
stack: _react2['default'].PropTypes.oneOf(['1x', '2x'])
border: _react2.default.PropTypes.bool,
className: _react2.default.PropTypes.string,
fixedWidth: _react2.default.PropTypes.bool,
flip: _react2.default.PropTypes.oneOf(['horizontal', 'vertical']),
inverse: _react2.default.PropTypes.bool,
name: _react2.default.PropTypes.string.isRequired,
pulse: _react2.default.PropTypes.bool,
rotate: _react2.default.PropTypes.oneOf([90, 180, 270]),
size: _react2.default.PropTypes.oneOf(['lg', '2x', '3x', '4x', '5x']),
spin: _react2.default.PropTypes.bool,
stack: _react2.default.PropTypes.oneOf(['1x', '2x'])
},
render: function render() {
var className = 'fa fa-' + this.props.name;
var _props = this.props;
var border = _props.border;
var fixedWidth = _props.fixedWidth;
var flip = _props.flip;
var inverse = _props.inverse;
var name = _props.name;
var pulse = _props.pulse;
var rotate = _props.rotate;
var size = _props.size;
var spin = _props.spin;
var stack = _props.stack;
if (this.props.size) {
className += ' fa-' + this.props.size;
var props = _objectWithoutProperties(_props, ['border', 'fixedWidth', 'flip', 'inverse', 'name', 'pulse', 'rotate', 'size', 'spin', 'stack']);
var className = 'fa fa-' + name;
if (size) {
className += ' fa-' + size;
}
if (this.props.spin) {
if (spin) {
className += ' fa-spin';
}
if (this.props.pulse) {
if (pulse) {
className += ' fa-pulse';
}
if (this.props.border) {
if (border) {
className += ' fa-border';
}
if (this.props.fixedWidth) {
if (fixedWidth) {
className += ' fa-fw';
}
if (this.props.inverse) {
if (inverse) {
className += ' fa-inverse';
}
if (this.props.flip) {
className += ' fa-flip-' + this.props.flip;
if (flip) {
className += ' fa-flip-' + flip;
}
if (this.props.rotate) {
className += ' fa-rotate-' + this.props.rotate;
if (rotate) {
className += ' fa-rotate-' + rotate;
}
if (this.props.stack) {
className += ' fa-stack-' + this.props.stack;
if (stack) {
className += ' fa-stack-' + stack;
}

@@ -98,3 +114,3 @@

return _react2['default'].createElement('span', _extends({}, this.props, {
return _react2.default.createElement('span', _extends({}, props, {
className: className

@@ -101,0 +117,0 @@ }));

{
"name": "react-fontawesome",
"version": "0.3.3",
"version": "1.0.0",
"description": "A React component for the font-awesome icon library.",

@@ -51,7 +51,12 @@ "repository": {

"devDependencies": {
"babel": "^5.8.23",
"babel-cli": "^6.6.5",
"babel-core": "^6.7.4",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-2": "^6.5.0",
"chai": "^3.2.0",
"eslint": "^1.2.1",
"eslint": "^2.5.3",
"eslint-plugin-nodeca": "^1.0.3",
"eslint-plugin-react": "^3.3.0",
"eslint-plugin-react": "^4.2.3",
"jsdoc-to-markdown": "^1.1.1",

@@ -62,2 +67,4 @@ "jsdom": "^6.2.0",

"mocha-sinon": "^1.1.4",
"react": "^15.0.1",
"react-dom": "^15.0.1",
"sinon": "^1.16.1",

@@ -70,3 +77,2 @@ "sinon-chai": "^2.8.0"

},
"dependencies": {},
"peerDependencies": {

@@ -73,0 +79,0 @@ "react": ">=0.12.0"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc