@@ -70,7 +70,7 @@ export default class JSONIterableNode extends React.Component {
7070 if ( typeof this . props . previousData !== 'undefined' && this . props . previousData !== null ) {
7171 prevData = this . props . previousData [ key ] ;
7272 }
73- const node = grabNode ( key , value , prevData , this . props . theme ) ;
73+ const node = grabNode ( key , value , prevData , this . props . theme , this . props . styles , this . props . getItemString ) ;
7474 if ( node !== false ) {
7575 childNodes . push ( node ) ;
7676 }
@@ -83,7 +83,7 @@ export default class JSONIterableNode extends React.Component {
8383
8484 // Returns the "n entries" string for this node, generating and
8585 // caching it if it hasn't been created yet.
86- getItemString ( ) {
86+ getItemString ( itemType ) {
8787 if ( ! this . itemString ) {
8888 const { data } = this . props ;
8989 let count = 0 ;
@@ -96,7 +96,7 @@ export default class JSONIterableNode extends React.Component {
9696 }
9797 this . itemString = count + ' entr' + ( count !== 1 ? 'ies' : 'y' ) ;
9898 }
99- return this . itemString ;
99+ return this . props . getItemString ( 'Iterable' , this . props . data , this . itemString , itemType ) ;
100100 }
101101
102102 render ( ) {
@@ -123,18 +123,24 @@ export default class JSONIterableNode extends React.Component {
123123 }
124124 return (
125125 < li style = { containerStyle } >
126- < JSONArrow theme = { this . props . theme } open = { this . state . expanded } onClick = { ::this . handleClick } />
126+ < JSONArrow theme = { this . props . theme } open = { this . state . expanded } onClick = { ::this . handleClick } style = { this . props . styles . getArrowStyle ( this . state . expanded ) } />
127127 < label style = { {
128128 ...styles . label ,
129- color : this . props . theme . base0D
129+ color : this . props . theme . base0D ,
130+ ...this . props . styles . getLabelStyle ( 'Iterable' , this . state . expanded )
130131 } } onClick = { ::this . handleClick } >
131132 { this . props . keyName } :
132133 </ label >
133- < span style = { spanStyle } onClick = { ::this . handleClick } >
134- < span style = { styles . spanType } > ()</ span >
135- { this . getItemString ( ) }
134+ < span style = { {
135+ ...spanStyle ,
136+ ...this . props . styles . getPreviewStyle ( 'Iterable' , this . state . expanded )
137+ } } onClick = { ::this . handleClick } >
138+ { this . getItemString ( < span style = { styles . spanType } > ()</ span > ) }
136139 </ span >
137- < ol style = { childListStyle } >
140+ < ol style = { {
141+ ...childListStyle ,
142+ ...this . props . styles . getListStyle ( 'Iterable' , this . state . expanded )
143+ } } >
138144 { childNodes }
139145 </ ol >
140146 </ li >
0 commit comments