tingle-icon
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "tingle-icon", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "svg icon", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/tinglejs/tingle-icon.git", |
@@ -8,2 +8,3 @@ /** | ||
*/ | ||
var classnames = require('classnames'); | ||
class Icon extends React.Component { | ||
@@ -16,6 +17,8 @@ | ||
render() { | ||
return ( | ||
<svg className={this.props.className} | ||
dangerouslySetInnerHTML={{__html: '<use xlink:href="#' + this.props.id + '"/>'}}/> | ||
); | ||
var t = this; | ||
return <svg className={classnames('tIcon', { | ||
[t.props.className]: !!t.props.className | ||
})} dangerouslySetInnerHTML={{ | ||
__html: '<use xlink:href="#' + t.props.id + '"/>' | ||
}}/> | ||
} | ||
@@ -25,3 +28,2 @@ } | ||
Icon.defaultProps = { | ||
className: 'tIcon' | ||
} | ||
@@ -31,6 +33,6 @@ | ||
Icon.propTypes = { | ||
className: React.PropTypes.string, | ||
id : React.PropTypes.string.isRequired | ||
className: React.PropTypes.string, | ||
id: React.PropTypes.string.isRequired | ||
} | ||
module.exports = Icon; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19748
49