Show loading more when rows aren't done rendering
This commit is contained in:
@@ -196,9 +196,11 @@ export default class CycleChart extends Component {
|
||||
renderItem={this.renderColumn}
|
||||
keyExtractor={item => item}
|
||||
initialNumToRender={15}
|
||||
maxToRenderPerBatch={5}
|
||||
windowSize={30}
|
||||
onLayout={() => this.setState({chartLoaded: true})}
|
||||
onEndReached={() => this.setState({end: true})}
|
||||
ListFooterComponent={<LoadingMoreView end={this.state.end}/>}
|
||||
updateCellsBatchingPeriod={800}
|
||||
/>
|
||||
}
|
||||
</View>
|
||||
@@ -206,6 +208,16 @@ export default class CycleChart extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
function LoadingMoreView(props) {
|
||||
return (
|
||||
<View style={styles.loadingMore}>
|
||||
{!props.end &&
|
||||
<AppText>{labels.loadingMore}</AppText>
|
||||
}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
function getTodayAndPreviousDays(n) {
|
||||
const today = new Date()
|
||||
today.setHours(0)
|
||||
|
||||
@@ -122,6 +122,11 @@ const styles = {
|
||||
symptomRow: {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
loadingMore: {
|
||||
height: '100%',
|
||||
backgroundColor: 'lightgrey',
|
||||
justifyContent: 'center'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user