Skip to content
Snippets Groups Projects
Commit d90ee4f8 authored by Julia Friesel's avatar Julia Friesel
Browse files

Show loading more when rows aren't done rendering

parent 1f1c6ed6
No related branches found
No related tags found
No related merge requests found
...@@ -196,9 +196,11 @@ export default class CycleChart extends Component { ...@@ -196,9 +196,11 @@ export default class CycleChart extends Component {
renderItem={this.renderColumn} renderItem={this.renderColumn}
keyExtractor={item => item} keyExtractor={item => item}
initialNumToRender={15} initialNumToRender={15}
maxToRenderPerBatch={5}
windowSize={30} windowSize={30}
onLayout={() => this.setState({chartLoaded: true})} onLayout={() => this.setState({chartLoaded: true})}
onEndReached={() => this.setState({end: true})}
ListFooterComponent={<LoadingMoreView end={this.state.end}/>}
updateCellsBatchingPeriod={800}
/> />
} }
</View> </View>
...@@ -206,6 +208,16 @@ export default class CycleChart extends Component { ...@@ -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) { function getTodayAndPreviousDays(n) {
const today = new Date() const today = new Date()
today.setHours(0) today.setHours(0)
......
...@@ -122,6 +122,11 @@ const styles = { ...@@ -122,6 +122,11 @@ const styles = {
symptomRow: { symptomRow: {
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
},
loadingMore: {
height: '100%',
backgroundColor: 'lightgrey',
justifyContent: 'center'
} }
} }
......
...@@ -12,6 +12,7 @@ export const shared = { ...@@ -12,6 +12,7 @@ export const shared = {
date: 'Date', date: 'Date',
cycleDayWithLinebreak: 'Cycle\nday', cycleDayWithLinebreak: 'Cycle\nday',
loading: 'Loading ...', loading: 'Loading ...',
loadingMore: 'Loading more ...',
more: 'more', more: 'more',
less: 'less' less: 'less'
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment