...
|
...
|
@@ -60,27 +60,30 @@ export default class List extends Component { |
|
|
let articles = this.props.data.get('articles');
|
|
|
let list = articles.get('list');
|
|
|
let isFetching = articles.get('isFetching');
|
|
|
if (!list||!list.size) {
|
|
|
return null;
|
|
|
|
|
|
if (!list || !list.size) {
|
|
|
return <LoadingIndicator
|
|
|
isVisible={isFetching}
|
|
|
/>;
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
<View style={styles.container}>
|
|
|
<ListView
|
|
|
contentContainerStyle={styles.contentContainer}
|
|
|
enableEmptySections={true}
|
|
|
showsVerticalScrollIndicator={false}
|
|
|
dataSource={this.dataSource.cloneWithRows(list.toArray())}
|
|
|
renderRow={this.renderRow}
|
|
|
renderHeader={this.renderHeader}
|
|
|
onEndReached={() => {
|
|
|
if (list && list.length) {
|
|
|
if (list && list.size) {
|
|
|
this.props.onEndReached && this.props.onEndReached();
|
|
|
}
|
|
|
}}
|
|
|
renderFooter={()=>{
|
|
|
if (list && list.length && isFetching) {
|
|
|
if (list && list.size && isFetching) {
|
|
|
return <LoadMoreIndicator
|
|
|
isVisible={isLoadingMore}
|
|
|
isVisible={true}
|
|
|
animating={true}
|
|
|
/>;
|
|
|
} else {
|
...
|
...
|
@@ -88,9 +91,7 @@ export default class List extends Component { |
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
<LoadingIndicator
|
|
|
isVisible={isFetching}
|
|
|
/>
|
|
|
|
|
|
</View>
|
|
|
);
|
|
|
}
|
...
|
...
|
|