...
|
...
|
@@ -37,6 +37,9 @@ export default class TransferShipment extends Component { |
|
|
render() {
|
|
|
let {resource} = this.props;
|
|
|
let dataList = resource?resource.get('records'):null;
|
|
|
let isLoadingMore = resource.get('isFetching') && resource.get('currentPage') > 0;
|
|
|
let endReached = resource.get('endReached');
|
|
|
|
|
|
return (
|
|
|
<View style={styles.container}>
|
|
|
<ListView
|
...
|
...
|
@@ -44,12 +47,25 @@ export default class TransferShipment extends Component { |
|
|
dataSource={this.dataSource.cloneWithRows(dataList?dataList.toArray():[])}
|
|
|
renderRow={this._renderRow}
|
|
|
enableEmptySections={true}
|
|
|
renderFooter={()=>{
|
|
|
if (endReached) {
|
|
|
return <View style={styles.placeholder} />;
|
|
|
} else {
|
|
|
return <LoadMoreIndicator isVisible={isLoadingMore} animating={true}/>;
|
|
|
}
|
|
|
}}
|
|
|
onEndReached={() => {
|
|
|
if (dataList && dataList.size > 0) {
|
|
|
this.props.onEndReached && this.props.onEndReached();
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
let {width, height} = Dimensions.get('window');
|
|
|
const styles = StyleSheet.create({
|
|
|
container: {
|
|
|
flex: 1,
|
...
|
...
|
@@ -58,5 +74,9 @@ const styles = StyleSheet.create({ |
|
|
listContainer: {
|
|
|
flex: 1,
|
|
|
backgroundColor: 'white',
|
|
|
}
|
|
|
},
|
|
|
placeholder: {
|
|
|
width,
|
|
|
height: 15,
|
|
|
},
|
|
|
}); |
...
|
...
|
|