@@ -127,25 +127,21 @@ export default class ColorPalette extends PureBaseComponent {
127
127
return this . getUniqueColors ( this . props . colors ) ;
128
128
}
129
129
130
- getUniqueColors = memoize (
131
- ( colors ) => {
132
- const c = _ . map ( colors , color => {
133
- if ( Colors . isTransparent ( color ) ) {
134
- return color ;
135
- }
136
- return _ . toUpper ( color ) ;
137
- } ) ;
138
- return _ . uniq ( c ) ;
139
- }
140
- ) ;
130
+ getUniqueColors = memoize ( ( colors ) => {
131
+ const c = _ . map ( colors , color => {
132
+ if ( Colors . isTransparent ( color ) ) {
133
+ return color ;
134
+ }
135
+ return _ . toUpper ( color ) ;
136
+ } ) ;
137
+ return _ . uniq ( c ) ;
138
+ } ) ;
141
139
142
140
getNumberOfRows ( ) {
143
141
const { numberOfRows} = this . props ;
144
142
145
143
if ( ! _ . inRange ( numberOfRows , 2 , 6 ) ) {
146
- console . warn (
147
- `${ numberOfRows } is not within valid range of color rows (2 to 5); defaulting to ${ DEFAULT_NUMBER_OF_ROWS } .`
148
- ) ;
144
+ console . warn ( `${ numberOfRows } is not within valid range of color rows (2 to 5); defaulting to ${ DEFAULT_NUMBER_OF_ROWS } .` ) ;
149
145
return DEFAULT_NUMBER_OF_ROWS ;
150
146
}
151
147
return numberOfRows ;
@@ -203,21 +199,18 @@ export default class ColorPalette extends PureBaseComponent {
203
199
if ( childRef ) {
204
200
const handle = findNodeHandle ( childRef ) ;
205
201
if ( handle ) {
206
- UIManager . measureLayoutRelativeToParent (
207
- handle ,
208
- e => {
209
- console . warn ( e ) ;
210
- } ,
211
- ( x , y , w , h ) => {
212
- if ( x + w > Constants . screenWidth ) {
213
- this . scrollView . current . scrollTo ( {
214
- x : x + w + HORIZONTAL_PADDING - Constants . screenWidth ,
215
- y : 0 ,
216
- animated : false
217
- } ) ;
218
- }
202
+ UIManager . measureLayoutRelativeToParent ( handle , e => {
203
+ console . warn ( e ) ;
204
+ } ,
205
+ ( x , y , w , h ) => {
206
+ if ( x + w > Constants . screenWidth ) {
207
+ this . scrollView . current . scrollTo ( {
208
+ x : x + w + HORIZONTAL_PADDING - Constants . screenWidth ,
209
+ y : 0 ,
210
+ animated : false
211
+ } ) ;
219
212
}
220
- ) ;
213
+ } ) ;
221
214
}
222
215
}
223
216
} else if ( this . usePagination ) {
0 commit comments