File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ var type = 'svg',
4141 return template
4242 . replace ( '__TYPE__' , type )
4343 . replace ( / _ _ N A M E _ _ / g, name )
44- . replace ( '__SVG__' , data . replace ( '<svg' , '<svg {...this. props}' ) ) ;
44+ . replace ( '__SVG__' , data . replace ( '<svg' , '<svg {...props}' ) ) ;
4545} ;
4646
4747var transform = function ( filename ) {
Original file line number Diff line number Diff line change 44 "homepage" : " https://github.com/coma/svg-reactify" ,
55 "repository" : " https://github.com/coma/svg-reactify" ,
66 "main" : " ./index.js" ,
7- "version" : " 1.0.0 " ,
7+ "version" : " 1.0.1 " ,
88 "license" : " MIT" ,
99 "private" : false ,
1010 "authors" : [
Original file line number Diff line number Diff line change 11var React = require ( 'react' ) ,
2- SVG = __SVG__ ;
2+ SVG = function ( props ) {
3+
4+ return __SVG__ ;
5+ } ;
36
47module . exports = React . createClass ( {
58 displayName : 'svg-__NAME__' ,
69 propTypes : {
7- type : React . PropTypes . oneOf ( [ 'svg' , 'icon' ] )
10+ type : React . PropTypes . oneOf ( [ 'svg' , 'icon' ] ) ,
11+ svg : React . PropTypes . object
812 } ,
913 getDefaultProps : function ( ) {
1014
1115 return {
12- type : '__TYPE__'
16+ type : '__TYPE__' ,
17+ svg : { }
1318 } ;
1419 } ,
1520 render : function ( ) {
1621
1722 switch ( this . props . type ) {
1823
1924 case 'svg' :
20- return SVG ;
25+ return SVG ( this . props ) ;
2126
2227 case 'icon' :
2328
@@ -28,7 +33,7 @@ module.exports = React.createClass({
2833 className += ' ' + this . props . className ;
2934 }
3035
31- return < span { ...this . props } className = { className } > { SVG } </ span > ;
36+ return < span { ...this . props } className = { className } > { SVG ( this . props . svg ) } </ span > ;
3237 }
3338 }
3439} ) ;
Original file line number Diff line number Diff line change 1- var React = require ( 'react' ) ;
1+ var React = require ( 'react' ) ,
2+ SVG = function ( props ) {
3+
4+ return __SVG__ ;
5+ } ;
26
37module . exports = React . createClass ( {
48 displayName : 'svg-__NAME__' ,
9+ propTypes : {
10+ svg : React . PropTypes . object
11+ } ,
12+ getDefaultProps : function ( ) {
13+
14+ return {
15+ svg : { }
16+ } ;
17+ } ,
518 render : function ( ) {
619
720 var className = 'icon icon-__NAME__' ;
@@ -11,6 +24,6 @@ module.exports = React.createClass({
1124 className += ' ' + this . props . className ;
1225 }
1326
14- return < span { ...this . props } className = { className } > __SVG__ </ span > ;
27+ return < span { ...this . props } className = { className } > { SVG ( this . props . svg ) } </ span > ;
1528 }
1629} ) ;
Original file line number Diff line number Diff line change 1- var React = require ( 'react' ) ;
1+ var React = require ( 'react' ) ,
2+ SVG = function ( props ) {
3+
4+ return __SVG__ ;
5+ } ;
26
37module . exports = React . createClass ( {
48 displayName : 'svg-__NAME__' ,
59 render : function ( ) {
610
7- return __SVG__ ;
11+ return SVG ( this . props ) ;
812 }
913} ) ;
You can’t perform that action at this time.
0 commit comments