react-svg-icon
Advanced tools
Comparing version 0.2.0 to 0.2.2
@@ -63,3 +63,5 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { 'default': obj }; | ||
} | ||
@@ -69,3 +71,3 @@ var _componentsIcon = __webpack_require__(1); | ||
var _componentsIcon2 = _interopRequireDefault(_componentsIcon); | ||
exports['default'] = _componentsIcon2['default']; | ||
@@ -84,3 +86,5 @@ module.exports = exports['default']; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { 'default': obj }; | ||
} | ||
@@ -106,7 +110,3 @@ var _react = __webpack_require__(2); | ||
return _react2['default'].createElement( | ||
'svg', | ||
{ className: className.join(' ') }, | ||
_react2['default'].createElement('use', { xlinkHref: '#i-' + this.props.name }) | ||
); | ||
return _react2['default'].createElement('svg', { className: className.join(' ') }, _react2['default'].createElement('use', { xlinkHref: '#i-' + this.props.name })); | ||
} | ||
@@ -113,0 +113,0 @@ |
@@ -9,2 +9,3 @@ import React from 'react'; | ||
name: React.PropTypes.string.isRequired, | ||
title: React.PropTypes.string, | ||
className: React.PropTypes.string | ||
@@ -14,10 +15,14 @@ }, | ||
render() { | ||
const className = ['i']; | ||
if (this.props.className) { | ||
className.push(this.props.className); | ||
const { name, title, className } = this.props; | ||
let classNames = ['i']; | ||
if (className) { | ||
classNames.push(className); | ||
} | ||
return ( | ||
<svg className={className.join(' ')}> | ||
<use xlinkHref={'#i-' + this.props.name} /> | ||
<svg className={classNames.join(' ')} aria-labelledby={title ? 'svgtitle_' + name : null}> | ||
{title ? (<title id={'svgtitle_' + name}>{title}</title>) : null} | ||
<use xlinkHref={'#i-' + name} /> | ||
</svg> | ||
@@ -24,0 +29,0 @@ ); |
{ | ||
"name": "react-svg-icon", | ||
"version": "0.2.0", | ||
"version": "0.2.2", | ||
"description": "React SVG icon component", | ||
@@ -27,6 +27,4 @@ "main": "./build/lib/index.js", | ||
"devDependencies": { | ||
"babel-eslint": "^4.1.6", | ||
"chai": "^3.4.0", | ||
"eslint": "^1.8.0", | ||
"eslint-config-airbnb": "^0.1.0", | ||
"eslint-plugin-react": "^3.6.3", | ||
"jsdom": "^7.0.2", | ||
@@ -33,0 +31,0 @@ "mocha": "^2.3.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8
0
40938
10
130