@@ -75,6 +75,9 @@ export type Props = {
75
75
* sure to also set the `refreshing` prop correctly.
76
76
*/
77
77
onRefresh ?: ?Function ,
78
+ wrapperStyle ?: Object ,
79
+ columnWrapperStyle ?: any ,
80
+ verticalSeparatorWidth ?: number ,
78
81
} ;
79
82
type State = {
80
83
columns : Array < Column > ,
@@ -113,6 +116,9 @@ export default class MasonryList extends React.Component<Props, State> {
113
116
}
114
117
return < ScrollView { ...props } /> ;
115
118
} ,
119
+ verticalSeparatorWidth : 0 ,
120
+ wrapperStyle : { } ,
121
+ columnWrapperStyle : { } ,
116
122
} ;
117
123
118
124
state = _stateFromProps ( this . props ) ;
@@ -205,7 +211,18 @@ export default class MasonryList extends React.Component<Props, State> {
205
211
return { length : column . heights [ rowIndex ] , offset, index : rowIndex } ;
206
212
} ;
207
213
208
- _renderScrollComponent = ( ) => < FakeScrollView style = { styles . column } /> ;
214
+ _renderScrollComponent = columnIndex => {
215
+ const { verticalSeparatorWidth, columnWrapperStyle } = this . props ;
216
+ return (
217
+ < FakeScrollView
218
+ style = { [
219
+ styles . column ,
220
+ { marginLeft : ( columnIndex > 0 ) ? verticalSeparatorWidth : 0 } ,
221
+ ( typeof columnWrapperStyle === 'function' ) ? columnWrapperStyle ( columnIndex ) : columnWrapperStyle
222
+ ] }
223
+ />
224
+ ) ;
225
+ } ;
209
226
210
227
_getItemCount = data => data . length ;
211
228
@@ -219,6 +236,7 @@ export default class MasonryList extends React.Component<Props, State> {
219
236
ListHeaderComponent ,
220
237
keyExtractor ,
221
238
onEndReached ,
239
+ wrapperStyle ,
222
240
...props
223
241
} = this . props ;
224
242
let headerElement ;
@@ -240,7 +258,7 @@ export default class MasonryList extends React.Component<Props, State> {
240
258
this . _getItemLayout ( col . index , index ) }
241
259
renderItem = { ( { item, index } ) =>
242
260
renderItem ( { item, index, column : col . index } ) }
243
- renderScrollComponent = { this . _renderScrollComponent }
261
+ renderScrollComponent = { ( ) => this . _renderScrollComponent ( col . index ) }
244
262
keyExtractor = { keyExtractor }
245
263
onEndReached = { onEndReached }
246
264
onEndReachedThreshold = { this . props . onEndReachedThreshold }
0 commit comments